Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.open opens blank window not url I want

Status
Not open for further replies.

shaunacg

Programmer
Aug 1, 2003
71
GB
I have an onClick="emailfriend()"; that seems to call the emailfriend() function ok. But all I get is an empty window opening up, without the sizing or title. What's wrong with this? Please help.

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function emailfriend()
{
window.open(&quot; &quot;Title&quot;, &quot;width=450, height=450, status=yes, resizable=no&quot;);
}
</SCRIPT>

Thanks
 
I got an error trying your code exactly as you have it. When I took out the semicolon after the link in the window.open parameter list [window.open(&quot;] it worked just fine.

Also, just in case, make sure your title doesn't have any space in it. It doesn't make sense to me that that should be a problem, but I have encountered issues with that before.

Good luck.

--Dave
 
Let me get this right, you have a link on your site &quot;E-Mail Friend&quot;, when clicking on the link, do you want a popup window to open or do you want to open an email link?
 
Sorry I don't know what I had that semi-colon doing there after but for some reason it still won't work for me and I don't have a space in the title. Thanks though.

And it is a popup window I'm trying to open. With a link to another page.

But this could be the problem: my page is saved as a .asp page. Will javascript only work in HTML saved pages?
 
Put something like this in the <head> part of your web page ...

<script language=&quot;JavaScript&quot;>
function open(){
window.open(&quot; &quot;null&quot;, &quot;height=340, width=520, scrollbars=yes, top=30, left=30&quot;)
}
</script>

This the actual link that executes the above piece of code.
<a href=&quot;javascript:eek:pen()&quot;>Click to open popup window</a>

... also make sure you have javascript enabled in your browser.

Yes javascript works in *.asp pages, also in *.php

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top