RE: [PHP] setting var inside JS
| From: | Brian V Bonini | Date: | Wed, 07 Aug 2002 18:40:19 +0000 |
| Subject: | RE: [PHP] setting var inside JS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111558@lists.php.net to get a copy of this message | ||
Hmm, thanks, I think. I was not really looking for an analysis of my syntax
but ok... I'm always up for an additional tip.. :)
Personally, I'm not really sure how else you would write it but the code
produces exactly what it should so I'm not sure why your telling me it "wont
work":
<a href="#"
onclick="popup('./?id=2&nw=1','ig','width=640,height=455,toolbar=no,scrollba
rs=yes,resizable=yes,location=no');"><img
src="/ss/thumbnails/2.jpg"width="48" height="75"alt="click to
enlarge"
/></a></td><td>
The problem is "nw" does not seem to be getting passed to php the same way
it would if the above were written:
<a href="./?id=2&nw=1" etc...
So, my question stands....
Thanks,
-B
*************
> -----Original Message-----
> From: Andrew Brampton [mailto:andrew@bramp.freeserve.co.uk]
> Sent: Wednesday, August 07, 2002 2:24 PM
> To: Brian V Bonini; PHP Lists
> Subject: Re: [PHP] setting var inside JS
>
>
> 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,r
> esizable=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,r
> esizable=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
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>