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

Q1007 What is the continuation character in JavaScript?

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

Normally if you require a long text string, you break it up into smaller chunks and then just add the chunks together:

<SCRIPT LANGUAGE="JavaScript"><!--
var foobar = "Hello I wish this would" +
             " work" +
             " and it does";
//--></SCRIPT>

However, you can use the \ character to continue onto the next line:

<SCRIPT LANGUAGE="JavaScript"><!--
var foobar = "Hello I wish this would \
work \
and it does";
//--></SCRIPT>

©2018 Martin Webb