dzash2000
asked on
cross browser compatible Popup window with simple javascript
Hi - I'm trying to get a simple extra browser window to open when I click a button. It's a demo of how a Help file will open in another window when the user clicks the "?" button.
I found the script attached and was happy with all the options it provided but I'm getting really sketchy results.
IE6 "blinks" when the new window opens. The window calling the function kind of goes blank for a second.
Firefox wants to download the new content or open it with IE.
Is this a simple thing to remedy?
Thanks in advance for your experience.
d2
I found the script attached and was happy with all the options it provided but I'm getting really sketchy results.
IE6 "blinks" when the new window opens. The window calling the function kind of goes blank for a second.
Firefox wants to download the new content or open it with IE.
Is this a simple thing to remedy?
Thanks in advance for your experience.
d2
function openHelpWin()
{
window.open("_help/HelpFile.mht","_blank","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=480, height=270");
}
<!-- and then I call it with this -->
<input type="image" src="_images/square_Help_btn_off.jpg" alt="HELP" onclick="openHelpWin()" />
Not sure about that IE6 reloading - I'll fire up the laptop tomorrow and try your example.
Meanwhile: I have found the spaces in the features list are a Very Bad Thing. Sometimes they will be applied, sometimes not, so I always remove spaces. Thus this:
"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=480, height=270"
becomes this:
"toolbar=no,location=no,di rectories= no,status= no,menubar =no,scroll bars=yes,r esizable=n o,copyhist ory=no,wid th=480,hei ght=270"
Meanwhile: I have found the spaces in the features list are a Very Bad Thing. Sometimes they will be applied, sometimes not, so I always remove spaces. Thus this:
"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, copyhistory=no, width=480, height=270"
becomes this:
"toolbar=no,location=no,di
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
bugada - thanks. "return false" was the magic word(s) that did the trick. It works great now.
ASKER
Here's more information.
I found out what was happening when IE6 blinks out as I described before. The source page (the page with the Help button calling the function) is reloading!
This make the whole situation even worse. I need to keep the source page from reloading. That's imperative!
I hope I explained this well enough.
TIA
d2