max length of eval expression

S

sudhaoncyberworld

using eval function i am executing a lengthy string expression...in
fact i am framing some string which contains the commands of creating
elements using dom2...this is very very lengthy string

Is there any limitation for that

eval(exp);
here what is max length(limitation) of exp ?

thanks
Sudhakar
 
S

sudhaoncyberworld

this is we are executing on client side....so we can't fix it....a
typical expression length was about 35000 chars...it may go more than
this
 
V

VK

this is we are executing on client side....so we can't fix it....a
typical expression length was about 35000 chars...it may go more than
this

Sorry, you did not understand, that was the answer, not a question :)

- What is the maxlength of exp in eval(exp) ?
- The maxlength is the available computer memory.

More precisely it's limited by the allowed string buffer (because exp
is passed as string). JavaScript is memory management free language so
theoretically any variable can take all available memory resource if
needed. From the other side String is using (the same as array)
indexing mechanics for its methods (like charAt) So I would expect some
problems to start after String.length will pass the magic level
4,294,967,295
But from the other side client browse will most probably send your
script to hell with such demands - and much earlier than that. :)
35000 chars - I never tried but officially nothing illegal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top