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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    windwo.open plroblems

    Im new to javascript and cant get my head round why this is not working i even copied direct from the book which i found had mistakes.

    <DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 TRANSITIONAL//EN

    "http://www.w3.org/TR/html4/loose.dtd">

    <HTML>

    <HEAD>

    <TITLE>oPENING A WINDOW<TITLE>

    <SCRIPT LANGUAGE="JAVASCRIPT" TYPE=TEXT/JAVASCRIPT">

    function newWindow() {

    catWindow = window.open("Sunset.jpg", "catWin", "width=330,height=250");

    }


    </SCRIPT>

    </HEAD>

    <BODY>

    <a HREF="javascript:newWindow()">click me</a>

    </BODY>

    </HTML>

    id be real greatful if any 1 could help me

  • #2
    Senior Coder coothead's Avatar
    Join Date
    Jan 2004
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    1,714
    Thanks
    0
    Thanked 238 Times in 233 Posts
    Hi there bobyyjavascript,

    and welcome to codingforums.

    Try it like this...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>opening a window</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    
    <script type="text/javascript">
    <!--
    function newWindow(url) {
    catWindow = window.open(url,"catWin","width=330,height=250");
     }
    //-->
    </script>
    
    </head>
    <body>
    
    <a href="Sunset.jpg" onclick="newWindow(this.href);return false">click me</a>
    
    </body>
    </html>
    coothead

  • #3
    Regular Coder Nischumacher's Avatar
    Join Date
    Oct 2005
    Location
    Bombay, India
    Posts
    196
    Thanks
    0
    Thanked 2 Times in 2 Posts
    <DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 TRANSITIONAL//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <title>oPENING A WINDOW</title>

    <script language="javascript" type="text/javascript">
    - NS 666
    .net DEVILoper


  •  

    Posting Permissions

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