Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Pop-up in MSIE 3.0 created on the fly?

    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....

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    what have you got that doesn't work with IE3.0?

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    344
    Thanks
    0
    Thanked 0 Times in 0 Posts

    eeeeeeeewwww WHY??

    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

  • #4
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: eeeeeeeewwww WHY??

    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!

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    don`t you need to remove the space between about and the colon (:) in the line:
    ("about :blank","","height="+imgHeight+",

    scroots
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #7
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •