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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window module can't be found for window.open

Status
Not open for further replies.

shaunacg

Programmer
Aug 1, 2003
71
GB
I have the following code in my HTML page:

<SCRIPT LANGUAGE=&quot;VBScript&quot;>
Function emailfriend()
window.open(&quot;EmailFriend.html&quot;, &quot;Title&quot;, &quot;width=450, height=450&quot;)
End Function
</SCRIPT>

<img src=&quot;images/icon-emailfriend.gif&quot; width=&quot;56&quot; height=&quot;55&quot; border=&quot;0&quot; alt=&quot;email page to a friend&quot; onClick=&quot;emailfriend()&quot;>

This does not work for me and results in an error saying that the window module can't be found. Why is this?

Thanks
 
VBScript does not recognize &quot;window.open&quot;. This is a javascript function.

Change it to this:

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

Mark
 
Hello,

I think window.open is under DOM. It should be and is supported by vbscript.

Under the assumption that (1) <script language=&quot;vbscript> and </script> part is placed within the <head> </head>, and (2) <img...> is within the <body></body>, the only work you have to do is to take away the parentheses, if you do not care about or make use of the return code. Hence, all you have to do is to have

window.open &quot;EmailFriend.html&quot;, &quot;Title&quot;, &quot;width=450, height=450&quot;

Otherwise, the problem lies somewhere else.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top