stupid little syntax error - javascript and php
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
<a href="javascript:window.open("picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>", ","Picture Viewer","toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no");> <img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
I thought you changed it to href='#' onclick='window.open etc
... also you have
... also you have
Code: Select all
, ",
// needs to be
, "",
// actually i think it just needs to be
,
Last edited by andre_c on Mon Mar 22, 2004 10:33 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Oh yea..... I changed it back because I was getting the link
http://www.domain.com/page.php?variable=398293# and was only returning the page to the top.. without any errors.....
I just was checking the errors for u
http://www.domain.com/page.php?variable=398293# and was only returning the page to the top.. without any errors.....
I just was checking the errors for u
Code: Select all
<a href="#" onclick="window.open("picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>", ","Picture Viewer","toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no");> <img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- andre_c
- Forum Contributor
- Posts: 412
- Joined: Sun Feb 29, 2004 6:49 pm
- Location: Salt Lake City, Utah
did you fix this
and add a " right before closing the onclick (or href, wherever you're doing it)
Code: Select all
...ure&title=$title"; ?>", ","Picture...
to this
...ure&title=$title"; ?>" ,"Picture...
Last edited by andre_c on Mon Mar 22, 2004 10:42 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
<a href="javascript:window.open('picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>', 'Picture Viewer','toolbar=0,status=0,menubar=0,scrollbars=no,resizable=no');"><img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
K I changed it to this and it is working fine except when I click on the picture and the popup appears fine, the original page reloads and it blank except for it sais [object].. jsut a white page that sais [object]
this is the new code I used
I change to onclick thing and it seems to be working fine.. thanks guys
this is the new code I used
Code: Select all
<a href="javascript:window.open('picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>',toolbar='0',status='0',menubar='0',scrollbars='no',resizable='no');"><img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
<? $size= getimagesize("portfolio/$type/$picture");
?>
<a href="#" onclick="window.open('picture.php?<? echo "type=$type&picture=$picture&title=$title"; ?>',width='<? echo "$size[0]"; ?>',toolbar='0',status='0',menubar='0',scrollbars='no',resizable='no',width='<? echo "$size[1]"; ?>');"><img src=" <? echo "portfolio/$type/$picture"; ?>" width="450" height="410" border="1"></a>