Jump to content

Open New Window


Daney11

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.