javascript variables

dadecoza

Expert Member
Joined
Aug 30, 2006
Messages
1,388
Reaction score
214
Location
~
hey guys,

I would like to know if it is possible to put a paragraph into a javascript variable.

okay that sounds a bit confusing, so let me show you how I would do it in perl ...

my $html = <<_EOHTML_;
<html>
<body>
hello world
</body>
</html>
_EOHTML_

or ...

my $html = qq {
<html>
<body>
hello world
</body>
</html>
_EOHTML_
};

The reason I want to do this is so that I can rather ....
document.getElementById('divMain').innerHTML = vHtml;

instead of concatinating a big ugly string together.

Thanks.
 
Top
Sign up to the MyBroadband newsletter
X