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!

Pop-Up Window

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to create a "Help" pop-up window using JavaScript for my website. Everything I have tried works in IE 4.0, but not Netscape (4.7). How can I create a window that works in both browsers when a user clicks on an image?
 
window.open() is supported by both browsers...what is the problem you come across?


jared@aauser.com
 
This is my code:

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--
function AddContractA_Help() {

window.open(&quot;&quot;,&quot;msg&quot;,&quot;scrollbars, width=475, height=350&quot;);
}
//-->
</SCRIPT>

I then call the function in the image located in the body of the page:

<IMG NAME=&quot;Help&quot; SRC=&quot;/images/Help.gif&quot; onClick=&quot;JavaScript:AddContractA_Help()&quot;>

In IE, a window pops up, but nothing happens in Netscape. I've also tried different functions from tutorials I found on the web and they all work in IE, but not Netscape.

I appreciate any help you can provide!
 
Netscape is very limited in the events that it supports.

It certainly doesnt support onClick events for images, but it does for anchor tags. So you need to enclose your image in an anchor:-

<A href=&quot;#&quot; onClick=&quot;JavaScript:AddContractA_Help()&quot;><IMG NAME=&quot;Help&quot; SRC=&quot;/images/Help.gif&quot;></A>

This should work for NN and IE.

HTH :)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top