mbhramar
04-17-2008, 10:41 AM
Hi,
I need to store a long formatted HTML code in a variable in javascript.
What I am doing right now is the following : (Just a random example)
txt = '<b>hello world</b> \
<h3> Menu 1 </h3>\
<h3> Menu 2 </h3>\
';
However I have fairly long Html code to assign to a js variable.
Can anyone please give me a better solution than one above. What would be great is that if I could simply create HTML on the fly with design tools like dreamweaver & then copy that HTML code & assign it to a variable using any good technique.
Right now I am using dreamweaver to design the HTML code. But I have to sit & manually correct the code appending 'slashes' to it like shown above.
Please help.
I need to store a long formatted HTML code in a variable in javascript.
What I am doing right now is the following : (Just a random example)
txt = '<b>hello world</b> \
<h3> Menu 1 </h3>\
<h3> Menu 2 </h3>\
';
However I have fairly long Html code to assign to a js variable.
Can anyone please give me a better solution than one above. What would be great is that if I could simply create HTML on the fly with design tools like dreamweaver & then copy that HTML code & assign it to a variable using any good technique.
Right now I am using dreamweaver to design the HTML code. But I have to sit & manually correct the code appending 'slashes' to it like shown above.
Please help.