Possible Duplicate:
Multiline Strings in Javascript
In Ruby you can do something like this
temp = <-SQLCODE select * from SQLCODE users
Thus, you have a very long string literal in your code, you do not need to avoid a lot of characters. Is there something similar in JavaScript?
I currently have javascript code similar to this and its driving me nuts ...
new Element.update(lightbox_id, " \
<div id='overlay' class='overlay' > \
</div> \
<div id='lightbox' class='lightbox'> \
<div class='lightbox_title'> \
<div class='corner_image' onclick=\"close_lightbox();return false;\"><a href='#' >" + corner_image + "</a></div> \
<div class='lightboxname' id='lightboxname'>" + title + "</div> \
<div class='close_image'> \
<a href='#' onclick=\"close_lightbox();return false;\">Close</a> or Escape key\
</div> \
</div> \
<div id='" + lightbox_content_id + "' class='lightbox_content'> \
</div> \
<script> \
watch_for_escape(); \
</script> \
</div> \
");
Janak source
share