CODECUBE VENTURES

Maximum Javascript String length

Apparently, you can't have a string longer than 127 characters in Javascript.

I discovered this when working on a dhtml application with a database backend. I had to build up these huge strings comprised of Div's, and write them out to the page in a document.write(). I started getting javascript errors at line 128 where it was expecting a paren ")".

In order to get it working, I had to split the string up into 127 character strings and do multiple document.write's

hope that helps someone out there in googleland

Latest post: Digging Up the First Version of CodeCube

See more in the archives