Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1116 Why is it not a good idea to have strings beyond 255 characters?

irt.org | Knowledge Base | JavaScript | Text | Q1116 [ previous next ]

Q1116 Why is it not a good idea to have strings beyond 255 characters?

This is true for older browsers only, that could not cope with long text strings, although it makes no difference in newer, it never hurts to code defensively.

Netscape Navigator 4 will slow down considerably if you document.write all strings. I always code strings like this - for readability and to avoid any potential string overflow:

<script language="JavaScript"><!--
var Text = '';
Text += 'This is a rather long piece of text';
Text += '\nSo it is stung together like this';
Text += '\nIt is ' + Text.length + ' long so far';
document.write(Text);
//--></script>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.