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

Popups inMozilla

Status
Not open for further replies.

steve100

Technical User
Aug 15, 2002
35
0
0
GB
Hi all this my problem:

I want to create a pop-up link to display RFT files.

This pop-up should always open in a new window (a web convention)

I don't want to use target="blank" (not valid xml)



Attempted solution 1:

If I simply omit the target attribute like so:

<a href=&quot;test.rtf&quot;>rtf document</a></body>

A new application window opens in Mozilla, but in IE the RTF opens in the same window.

Attempted solution 2:

Use Javascript to open a new window for IE but not for Mozilla

<a href=&quot;test.rtf&quot; onclick=&quot;browserTest(this.href);return false&quot;>rtf document</a></body>

<script>
<!--



function browserTest (c)

{
bname=navigator.appName
if (bname.indexOf(&quot;Netscape&quot;)!=-1)
{
newWindowMoz(c);
}
if (bname.indexOf(&quot;Microsoft&quot;)!=-1)
{
newWindowIE(c);
}
}


function newWindowIE(c)

{
window.open(c,'openwindow','width=400,height=400,scrollbars=yes,status=yes resizable=yes');
}


function newWindowMoz(c)

{

}

Result: Window doesn't open in Mozilla. I also tried opening then closing the window in Moz but the window remained open:

function newWindowMoz(c)

{
window.open(c,'openwindow','width=400,height=400,scrollbars=yes,status=yes resizable=yes');
openwindow.close();
}






//-->
</script>


Does any of you Javascript gurus know how to do this properly?

Many thanks
Steve






 


I've had another go - this script works in IE and Mozilla but not Opera!

<script>
<!--



function browserTest (c)

{
bname=navigator.appName
if (bname.indexOf(&quot;Netscape&quot;)!=-1)
{
newWindowMoz(c);
}
if (bname.indexOf(&quot;Microsoft&quot;)!=-1)
{
newWindowIE(c);
}
}


function newWindowIE(c)

{
window.open(c,'openwindow','width=400,height=400,scrollbars=yes,status=yes resizable=yes');
}


function newWindowMoz(c)

{
window.location(c);
document.open(&quot;test.rtf&quot;);
}








//-->
</script>

Any Opera experts out there?

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top