/    Sign up×
Community /Pin to ProfileBookmark

Maximum string length?

Does anyone know if there is a maximum string length that can be used in FF and IE browsers? ?

I can display a VERY long string (1200 characters or more) in the alert message, but I don’t know if this is the limit for other javascript commands.

In particular, I would like to know the maximum string length for a
“AnyArray = new Array()” element. 😮

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisAug 17.2006 — I didn't see anything specific in the ECMA spec (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf). It may be left to the implementation.
Copy linkTweet thisAlerts:
@hansschmuckerAug 17.2006 — The longest string size I've worked with (in FF) was around 300k characters = ~600 kB

It's pretty quick too, only rendering to a textbox takes ages ( up to 40 seconds )
Copy linkTweet thisAlerts:
@JMRKERauthorAug 18.2006 — Thanks for the information.

I am having a problem and wanted to eliminate one possible source.
Copy linkTweet thisAlerts:
@konithomimoAug 18.2006 — Unlike languages such as C++, there is no limit to string and/or array lengths in JS. The only limitations are those of the processor.

Even so, it is best to keep the length below 256, since some browsers will have trouble with larger strings.

On another note, when using document.write, you might get an error if your length is greater than 127.
×

Success!

Help @JMRKER spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...