RE: [PHP] A JS problem
| From: | John W. Holmes | Date: | Sun, 02 Mar 2003 04:17:30 +0000 |
| Subject: | RE: [PHP] A JS problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-137750@lists.php.net to get a copy of this message | ||
> document.write("<a
> href="/pics.php?view=popup&image=2003-01-January/image1.jpg"
>
> onclick="NewWindow(this.href,'popup','1000','672','no');return
> false;"><img
> src="/pics/2003-01-January/image1-thumb.jpg"
> border="0" alt="Image 1 of 64"></a> ")}
Shouldn't you be escaping some quotes here? The "string" your sending to
document.write() is delineated by double quotes, but there are double
quotes within the string itself. I'm sure that'll cause a JavaScript
error. Escape double quotes within the string with the \ character.
document.write("<a
href=\"/pics.php?view=popup&image=2003-01-January/image1.jpg\"
onclick=\"NewWindow(this.href,'popup','1000','672','no');return
false;\"><img
src=\"/pics/2003-01-January/image1-thumb.jpg\"
border=\"0\" alt=\"Image 1 of 64\"></a> ")}
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/