...

View Full Version : Pop-up in MSIE 3.0 created on the fly?



metalhead
06-25-2002, 01:07 AM
OK, this problem has been doing my head in for hours....There must be a solution because it sounds such a simple goal.

I need a javascript script that will display some HTML in a small pop-up window in Internet Explorer v3.0, and I need the page to be created in javascript too, ie. not to load a previously saved html page.


I'm not an experienced javascript programmer, but I have written a script that does the above for modern browsers I just can't get it to work in MSIE 3.0. I have tried loads of pre-written scripts on various websites and none of them work! :(

Can anybody please help....

glenngv
06-25-2002, 04:50 AM
what have you got that doesn't work with IE3.0?

QuackHead
06-25-2002, 04:02 PM
hmmm.. I'll look into this for you.

I have a version of IE3 (for re-direction testing only) installed on my test server. I'll see if I can get this to work...

p.s. WHY are you using IE 3?? What is the purpose .. I thought NO ONE used that browser anymore...

I'm sad for you ;) (kidding.. well... sort of)

~Quack

metalhead
06-25-2002, 04:41 PM
Originally posted by QuackHead
hmmm.. I'll look into this for you.

I have a version of IE3 (for re-direction testing only) installed on my test server. I'll see if I can get this to work...

Cheers QuackHead. :)


p.s. WHY are you using IE 3?? What is the purpose .. I thought NO ONE used that browser anymore...

I'm sad for you ;) (kidding.. well... sort of)

I don't use IE 3....But after looking at my website access log it appears many vistors to my website are. :( Therefore I wanted a pop-up window that would work for them too. I wish they would just all upgrade to later versions,...It would make everybodies life easier!

metalhead
06-25-2002, 04:59 PM
Originally posted by glenngv
what have you got that doesn't work with IE3.0?

The script below works fine in Netscape 4.2, ie. it opens a pop-up window displaying the HTML, but in MSIE 3.0 it just opens a blank pop-up window. MSIE 3.0 also displays the following error: Internet Explorer cannot open the site about:about. The protocol specified in the address is not valid. Make sure the address is correct, and try again.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
imagename = '';
function enlrge(imgnme,imgWidth,imgHeight)
{
lrgewin = window.open("about:blank","","height="+imgHeight+",width="+imgWidth+",screenX=0,screenY=0,top=0,left=0");
imagename = imgnme;
setTimeout('update()',500)
}

function update()
{
doc = lrgewin.document;
doc.open('text/html');
doc.write('<HTML><HEAD><TITLE>Enlarged Image<\/TITLE><\/HEAD><BODY bgcolor="#FFFFFF" MARGINHEIGHT="0" MARGINWIDTH="0" TOPMARGIN="0" LEFTMARGIN="0">');
doc.write('<IMG SRC="' + imagename + '">');
doc.write('<\/BODY><\/HTML>');
doc.close();
}
//--></SCRIPT>
</HEAD>
<BODY>
<A HREF="#" onClick="enlrge('tape.jpg',642,366);return false">Click here</A><BR>
<A HREF="JavaScript:enlrge('tape.jpg',642,366)">Click here</A><BR>
<A HREF="test.html" onClick="enlrge('tape.jpg',642,366);return false">Click here</A><BR>
</BODY>
</HTML>

The script below also works fine in Netscape 4.2, but in MSIE 3.0 'Test 1' only opens a blank pop-up window. 'Test 2' does the same, but also displays the JPEG in the parent window. 'Test 3' opens a blank pop-up window and displays the JPEG in a new full size window.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript"><!--
var popupwin=null;
var img_width=null;
var img_height=null;
var img=null;
function NewWindow(image,name,width,height)
{
img_width = width;img_height = height;img = image;
var settings ='width='+img_width+',height='+img_height+',top=0,left=0,location=no,menubar=no,resizable=no,scrollb ars=no,status=no,toolbar=no,directories=no';
popupwin = window.open('',name,settings);
setTimeout('update()',500)
}

function update()
{
doc = popupwin.document;
doc.open('text/html');
doc.write('<HTML><BODY MARGINHEIGHT=\"0\" MARGINWIDTH=\"0\" TOPMARGIN=\"0\" LEFTMARGIN=\"0\">');
doc.write('<IMG SRC=\"'+img+'\" WIDTH=\"'+img_width+'\" HEIGHT=\"'+img_height+'\" BORDER=\"0\">');
doc.write('<\/BODY><\/HTML>');
doc.close();
}
//--></SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#A80000" ALINK="#A80000">
<A HREF="tape.jpg" TARGET="_blank" OnClick="NewWindow(this.href,'Image',642,366);return false">Click for image</A><BR>
<A HREF="tape.jpg" OnClick="NewWindow(this.href,'Image',294,315);return false">Click for image</A><BR>
<A HREF="JavaScript:NewWindow('tape.jpg','Image',642,366)">Click for image</A><BR>
</BODY>
</HTML>

scroots
06-25-2002, 06:48 PM
don`t you need to remove the space between about and the colon (:) in the line:
("about :blank","","height="+imgHeight+",

scroots

metalhead
06-25-2002, 07:48 PM
Originally posted by scroots
don`t you need to remove the space between about and the colon (:) in the line:
("about :blank","","height="+imgHeight+",

scroots


There isn't an space there, its just word-wrapping there for some reason.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum