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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.