[thelist] JavaScript question
Sorgatz, Rex
rex at ibsys.com
Thu Jun 7 17:19:01 CDT 2001
After running into three dead ends, I'm coming to you.
I need to create a popup window -- without using any javascript in the
string or any functions in the referrer document.
"What?!" you say?
Here's what I mean. Say I email you a link, such as:
http://www.sitename.com/thiscoolpopup.html
I need *that* to popup. So, all the JavaScript must be found in *that*
document. I've got it working on IE & Netscape, but I conk out on all Macs
(and I need it to work cross-platform). Here's what I've got:
<script language="JavaScript">
if((this.opener+'') == 'undefined' || (this.opener+'') == 'null'){
var dom = document.domain;
if(dom.indexOf('html') == 0) dom = 'www' +
dom.substring(4,dom.length);
window.open(document.location,'testPopUp','height=100,width=100');
window.location.replace('http://www.sitename.com/');
//that line just makes the base URL load to the main page
} else{
htmlOut += '';
//etc..... [write out the document using htmlOut]. This part is
probably unnecessary.
document.write(htmlOut);
window.focus();
}
</script>
The problem that occurs: IE on Mac just "hangs" there. The popup just
refuses to recognize the document.domain and doesn't load the popup. And
heck if I know enough about the Mac DOM to figure this out.
Any ideas? Maybe I'm going in the completely wrong direction...
Thanx,
-rex
More information about the thelist
mailing list