Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Text | Q1116 [ previous next ]

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>

©2018 Martin Webb