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="test.rtf">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="test.rtf" onclick="browserTest(this.href);return false">rtf document</a></body>
<script>
<!--
function browserTest (c)
{
bname=navigator.appName
if (bname.indexOf("Netscape"
!=-1)
{
newWindowMoz(c);
}
if (bname.indexOf("Microsoft"
!=-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 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="test.rtf">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="test.rtf" onclick="browserTest(this.href);return false">rtf document</a></body>
<script>
<!--
function browserTest (c)
{
bname=navigator.appName
if (bname.indexOf("Netscape"
{
newWindowMoz(c);
}
if (bname.indexOf("Microsoft"
{
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