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
    Jul 2006
    Location
    Melbourne
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Can someone take a look at this code for me

    Hi there,
    I am a JS newbie and I am having trouble getting the following code to work within my IE6 Browser. It seems to work fine in Firefox, Opera, Netscape and Mozilla. I have checked the browser settings for Java script and have also disabled the popup blocker. Can anyone help?

    <html>
    <head>

    <SCRIPT LANGUAGE="JavaScript">


    function glossterm(term, desc)
    {
    var gen=window.open('','Cullinary Definition','width=400,height=100,status=no,scrollbars=no,resizable=yes,screenX=100,screenY=200,left =100,top=200');

    gen.document.write('<html><head><title>Cullinary Definition</title>');
    //gen.document.write('<link rel="stylesheet" href="style.css">');
    gen.document.write('</head><body>');
    gen.document.write('<p><strong>' + term + '</strong><br>');
    gen.document.write('"'+ desc + '</p>');
    gen.document.write('<p><a href="javascript:self.close()">Close</a> this window.</p>');
    gen.document.write('</body></html>');
    gen.document.close();
    }

    </script>

    </head>

    <body>

    <a href="javascript:glossterm('Hollandaise Sauce','Basic egg and butter sauce.');">hollandaise</a>

    </body>
    </html>

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure you do not have some sort of popup blocker?
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #4
    New to the CF scene
    Join Date
    Jul 2006
    Location
    Melbourne
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks guys,
    Maybe I should look at using a different technology. Although, I would like to get this one working as I hate to let bugs defeat me; Especially In such a simple piece of code!

  • #5
    Regular Coder RexxCrow's Avatar
    Join Date
    Jul 2006
    Location
    California
    Posts
    275
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Is this any better for ya?

    Code:
    <html><head><SCRIPT LANGUAGE="JavaScript">
    function glossterm(term, desc) {
    gen='<html><head><title>Cullinary Definition</title></head><body><p><strong>' + term + '</strong><br>'+ desc + '</p><p><a href="javascript:self.close();">Close</a> this window.</p></body></html>'
    nw=window.open("","CullinaryDefinition","width=400,height=100,status=no,scrollbars=no,resizable=yes,screenX=100,screenY=200,left=100,top=200");
    nw.document.write(gen); nw.document.close();
    }
    </script></head><body>
    <a href="javascript:glossterm('Hollandaise Sauce','Basic egg and butter sauce.');">hollandaise</a>
    </body></html>
    Last edited by RexxCrow; 07-27-2006 at 03:24 AM.

  • #6
    Regular Coder RexxCrow's Avatar
    Join Date
    Jul 2006
    Location
    California
    Posts
    275
    Thanks
    6
    Thanked 2 Times in 2 Posts
    Actually you have this working from what I tested you just need to make the window's name as one word.

    Quote Originally Posted by hecka
    <html>
    <head>

    <SCRIPT LANGUAGE="JavaScript">


    function glossterm(term, desc)
    {
    var gen=window.open('','CullinaryDefinition','width=400,height=100,status=no,scrollbars=no,resizable=yes,screenX=100,screenY=200,left=100,top=2 00');

    gen.document.write('<html><head><title>Cullinary Definition</title>');
    //gen.document.write('<link rel="stylesheet" href="style.css">');
    gen.document.write('</head><body>');
    gen.document.write('<p><strong>' + term + '</strong><br>');
    gen.document.write('"'+ desc + '</p>');
    gen.document.write('<p><a href="javascript:self.close()">Close</a> this window.</p>');
    gen.document.write('</body></html>');
    gen.document.close();
    }

    </script>

    </head>

    <body>

    <a href="javascript:glossterm('Hollandaise Sauce','Basic egg and butter sauce.');">hollandaise</a>

    </body>
    </html>

  • #7
    New to the CF scene
    Join Date
    Jul 2006
    Location
    Melbourne
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah,
    Thanks mate, that worked a treat. I should have picked up on the fact that there can not be any spaces passed in the arguement.


  •  

    Posting Permissions

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