Results 1 to 2 of 2

Thread: _blank

  1. #1
    Join Date
    Mar 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default _blank

    I hope i'm posting on the correct forum. Please forgive if not..

    I use a very simple script to act as a basic password protection. It's not in need of anything more secure.

    But how do i get the page called to load in a new window _blank ?

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    function Login(){
    var done=0;
    var username=document.login.username.value;
    username=username.toLowerCase();
    var password=document.login.password.value;
    password=password.toLowerCase();
    if (username=="user" && password=="pass") { window.location="./directoy/index.htm"; done=1; }

    if (done==0) { alert("Invalid login!"); }
    }
    // End -->
    </SCRIPT>

    Called by:
    <td>Username:</td>
    <td><input type=text name=username></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><input type=text name=password></td>
    </tr>
    <tr>
    <td colspan=2 align=center><input name="button" type=button onClick="Login()" value="Login!"></td>

    Help! )

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Use window.open() instead of window.location
    Jeremy | jfein.net

Bookmarks

Posting Permissions

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