Wednesday, May 21, 2008

Javascript literal strings max length

Answer: 1024 characters.

Example:
function update_div('very very very [...] very long html returned by the server') {
}

I was passing this lengthy server side generated function parameter with an Ajax call to the client. The script didn't run. I had to reduce the size of the parameter literal string on server side, send it, and parse it client side to expand (uncompress) it.

No comments: