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

Thread: were I am going

  1. #1
    New Coder
    Join Date
    Feb 2007
    Location
    FL
    Posts
    35
    Thanks
    4
    Thanked 0 Times in 0 Posts

    were I am going

    I wasnt to display a message when the user types a URL

    that reads "You are going to XX-Var NewSireName-XX"

    so far I have



    // HTML Code

    <body onUnload="UnLoad()">

    // Js Code

    function UnLoad(){
    alert(document.location); // returns my current web site
    }

  • #2
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question ???

    Am I understanding correctly???

    Are you wanting to make your site rigged up so that the user cannot leave?

    or are you just wanting a message to appear when they do leave?

    What kind of message are you wanting? Would a js alert do?

    We need more info to help


    ImperialSpider

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Cool try one of these scripts

    This is for a javascript (js) alert...you can add many more messages, or have them all say the same message if you wish... if you don't want the second alert message, delete it from the script.

    Code:
    <head>
    <script>
    window.onunload=function(){
    alert("You are going to XX-Var NewSireName-XX");
    alert("message 2 goes here");
    
    return true;
    }
    </script>
    </head>
    <body>
    This is the body of your website.
    </body>
    Or you can try this... it opens a new popup window of the same webpage the user was viewing when they closed their browser to get out of it.

    Code:
    <html>
    <head>
    <title>HA HA! Your Stuck!</title>
    
    <script type="text/javascript">
    
      <!--
      function goodbye(){
      newwin=window.open("yourwebsite.html");
      newwin.resizeTo(screen.width,screen.height);
      newwin.moveTo(0,0);
      }
      //-->
    
    </script> 
    </head>
    
    <body onunload="goodbye()">
      Your website content goes here.
      Oh, By the way...YOU ARE STUCK.  HA HA HA!  
    </body>
    </html>
    Hope one of these are what you were looking for...

    ImperialSpider


  •  

    Posting Permissions

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