Daney11 Posted February 7, 2007 Share Posted February 7, 2007 hey guys... Ive got this code below to open a new window and link it correctly... However, when i click on any link id for example a linked ID=4 it goes to id=20.. Every click is always id=20.. function load() { var load = window.open('<?php echo $website_url ?>team/<? echo "$team_id"; ?>/','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'); } the <? echo "$team_id"; ?> echos out 20 for some reason... But when i link it normal without the javascript the team_id echos out perfect.. :S Link to comment https://forums.phpfreaks.com/topic/37518-open-new-window/ Share on other sites More sharing options...
artacus Posted February 7, 2007 Share Posted February 7, 2007 You need to get rid of the '/' in team/<? Link to comment https://forums.phpfreaks.com/topic/37518-open-new-window/#findComment-179407 Share on other sites More sharing options...
Daney11 Posted February 7, 2007 Author Share Posted February 7, 2007 No, im using mod_rewrite to so actual url would be http://www.mysite.com/team/10 where 10 is the team_id Link to comment https://forums.phpfreaks.com/topic/37518-open-new-window/#findComment-179424 Share on other sites More sharing options...
artacus Posted February 9, 2007 Share Posted February 9, 2007 I was thinking you might be getting a space in there. Because that would be converted to 20%. Are you looking at your source code from your browser to make it's printing out like you expected? Try storing your team_id as a js var first; function load() { var url = '<?=$website_url ?>'; var team = '<?=$team_id ?>'; var load = window.open(url + 'team/' + team_id, 'New Window', 'scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no'); } Link to comment https://forums.phpfreaks.com/topic/37518-open-new-window/#findComment-180391 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.