Jump to content

Archived

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

Omid

Opening New Window

Recommended Posts

Hi folks, I have been working on a new script and i have met the same problem a couple of times and i've decided to ignore them until now  ;D. I have a php script and in the echo part, i have a link. I'm trying to get the link to open in a new window by using javascript but it doesnt work. [code]echo "<li><a href='javascript:newwindow()'>Edit</a></li>";[/code] and i have [code]<SCRIPT language="JavaScript">
function newwindow()
{
window.open('inc/menu.php?cmd=edit&id=$id','jav','width=300,height=200,resizable=no');
}
</SCRIPT>[/code] in the <head> section. Any help would be appreciated. Thanks ;D

Share this post


Link to post
Share on other sites
uhm... no i hadn't but i did now and still not working :S thanks anyways tho

Share this post


Link to post
Share on other sites
correct way:
window.open('url to open','window name','attribute1,attribute2')

try changing the 'window name' to "new" instead of jav

edit: also try _new

Share this post


Link to post
Share on other sites
For future references the window name can only be one of
new, blank... a few others by default.
unless you have set the window name

window.name="jav";

if you want to call it jav.

Share this post


Link to post
Share on other sites
wooow... it did have something to do with php... it was in a echo"" ... lol... ;D

Share this post


Link to post
Share on other sites

×

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.