Array & Javascript?
| From: | Marcus Ouimet | Date: | Thu, 26 Apr 2001 21:57:50 +0000 |
| Subject: | Array & Javascript? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-50513@lists.php.net to get a copy of this message | ||
I am trying to add a Javascript in array but it gives me an error unless
certain characters are commented which makes sense, but then the Javascript
won't run. Any ideas here is what I am trying:
<?
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => '
<A HREF="test.html" onmouseover="document.images[0].src='test1'.jpg;
return
true;">
<IMG SRC="images/reviews.jpg" BORDER=0></A>');
of course the ' characters are a problem etc. so for an example I tried:
<?
$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => '
<A HREF="test.html" onmouseover="document.images[0].src=\'test1\'.jpg;
return true;">
<IMG SRC="images/reviews.jpg" BORDER=0></A>');
Any suggestions on how to get this to work?