Re: setting var inside JS

From: Date: Wed, 07 Aug 2002 18:23:58 +0000
Subject: Re: setting var inside JS
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-111556@lists.php.net to get a copy of this message
nw seems to be set to 1 there, but it seems to me that your line is VERY messy due to all the ' and " try breaking it down a bit then you might have more luck with all the quotes, ie echo '<td>'; echo '<a href="#" onclick="popup(\'./?id=' . $row->id . '&nw=1\',\'ig\',\'width=640,height=455,toolbar=no,scrollbars=yes,resizable=y es,location=no\');">'; echo '<img src="/ss/thumbnails/' . $img . '"' . $size[3] . 'alt="click to enlarge" /></a></td>'; The middle line wont work, due to the overuse of ' and \' (which won't work inside the ' quotes)... Anyway this is just a start, take you a few minutes to sort out the middle line.. If you have trouble, write down what it should look like in the browser, then work back from that... Andrew ----- Original Message ----- From: "Brian V Bonini" <b-bonini@cox.net> To: "PHP Lists" <php-general@lists.php.net> Sent: Wednesday, August 07, 2002 7:17 PM Subject: [PHP] setting var inside JS > Is it possible to set a var in side a JS statement? I can not seem to set > "nw" in the following statement. > > echo '<td><a href="#" onclick="popup(\'./?id=' . > $row->id . > '&nw=1\',\'ig\',\'width=640,height=455,toolbar=no,scrollbars=yes,resizable=y > es,location=no\');"><img src="/ss/thumbnails/' . $img . > '"' . $size[3] . > 'alt="click to enlarge" /></a></td>'; > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.general (#111556) next »