Web Analytics Made Easy -
StatCounter naming a window - CodingForum

Announcement

Collapse
No announcement yet.

naming a window

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • naming a window

    Hi,

    I have this javascript code that pops up a new window when pressed. How do I name this window "Login". Here is the code:

    <form method="post" action="http://www.mysite/cgi/login.cgi" target="popupWin" onSubmit="javascript:
    var w = 140;
    var h = 147;
    var winFeatures = 'width='+w+',height='+h+',location=yes,scrollable,left=350,top=220,resizable=yes';
    var winPtr = window.open('', this.target, winFeatures);
    return true;">



    Thanks

  • #2
    First of all, re-do your code...

    here's what I suggest...

    Code:
    <html>
    <head>
    <title>test</title>
    <script language="JavaScript">
    <!--
    function openWindow()
    {
    var w = 140; 
    var h = 147; 
    var winFeatures = 'width='+w+',height='+h+',location=yes,scrollbars=yes,
    left=350,top=220,resizable=yes'; 
    var winPtr = window.open(this.target, 'Login', winFeatures); 
    //-->
    </script>
    </head>
    <body>
    <form method="post" action="http://www.mysite/cgi/login.cgi" target="popupWin" onSubmit="openWindow(); return true;">
    </form>
    </body>
    </html>
    Try that, see if it works - that's how you name a window..

    Here is the javascript openwindow function explained.

    Variable = window.Open('PAGE_URL', 'PAGE_NAME', 'PAGE_PROPERTIES');

    That's it

    ~Quack

    Comment

    Working...
    X