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
    Apr 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adress bar manipualtion

    Hi guys, i was doing a website and i wanted to add a nice feature to it. When a peron want to logout from my website he can type "logoff" in my address bar and the window closes here is my code

    <html>
    <script language="javascript">
    var l = window.location.href;
    var s = window.location.search;
    function checkbar()
    {
    if((s == "logoff") && (l == "logoff"))
    {
    window.close;
    }
    }

    </script>

    <body onload="checkbar();">



    </body>
    </html>

    It appears that if i type in "logoff" it goes to the MSN.com search page woth the loggoff search results. It seems that it always gets the current location. Is there a way to take the next location that the user will use, is ther a method for that?
    Please help, thank you

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No way around that, the address bar is completely inaccessible from javascript. If you could "take over" the address bar then it would also be possible for a hostile web site to do likewise and then monitor your web surfing.
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #3
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Or disguise it's real location.
    Omnis mico antequam dominus Spookster!


  •  

    Posting Permissions

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