I'm working on a JavaScript pop-up window for one of my pages.
The JavaScript for the URL link has single quotes in the string (see below).
Right now I am not backslashing the single quote marks. The script is outputting on the page and everything. In other words, it seems to be working alright without escaping the single quote marks.
// This is the URL to the big picture.
<a href="#" onClick="MM_openBrWindow('./directory/to/image/image1.jpg','automobile','width=902,height=599')">
// This is the image source for the thumbnail.
<img src="directory/to/image/image1.jpg" width="100" height="66" border="0"></a>
Does anybody know is there a reason I would need to backslash or escape the single quote marks?
In other words, would there be some browsers where the script would crash if it visited the page?
I had this (JavaScript) code on a web page several months ago. I'm just now starting to work the same code into the new page I'm working on. A few months ago I remember that JavaScript sometimes gets stubbon and won't work if you try to put foreign code (backslashes) into the JavaScript string.
I would appreciate any info that anyone could provide.
Thanks.