Javascript Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alky
    Confirmed User
    • Apr 2002
    • 5651

    #1

    Javascript Help

    I'm trying to do a simple javascript...

    What it does:
    If a person views my page and exits without clicking any links, a popup window comes up. But if they click a link, no popup comes up when the page unloads.

    I know its something with onClick="set a variable'

    then a function that is called in onUnload that checks the var value, but since I do not know Javascript at all I am lost.

    Any help is appreciated, thanks.
  • XXXManager
    So Fucking Banned
    • Mar 2002
    • 893

    #2
    <HTML>
    <HEAD>
    <SCRIPT>
    var clicked = 0;
    function click_link (url){
    clicked = 1;
    window.open(url);
    };

    function closewin()
    {
    if (clicked==0) {window.open('http://www.xxxmanager.com');};
    };

    </SCRIPT>
    </HEAD>
    <BODY ONUNLOAD="closewin();">
    <A

    HREF="Javascript:click_link('http://www.tgplay.com');">http://ww

    w.tgplay.com</A>
    <BR>
    <A

    HREF="Javascript:click_link('http://www.gofuckyourself.com');">h

    ttp://www.gofuckyourself.com</A>
    <BR>
    <BR>
    courtesy of XXXManager.com ;)
    </BODY>
    </HTML>

    Comment

    • XXXManager
      So Fucking Banned
      • Mar 2002
      • 893

      #3
      Hey.
      HTML code wont paste easy - so i changed all the "<" to "< " (added space so it wont fuckup the reply)...
      So here it is
      <HR>

      < HTML>
      < HEAD>
      < SCRIPT>
      var clicked = 0;
      function click_link (url){
      clicked = 1;
      window.open(url);
      };

      function closewin()
      {
      if (clicked==0) {window.open('http://www.xxxmanager.com');};
      };

      < /SCRIPT>
      < /HEAD>
      < BODY ONUNLOAD="closewin();">
      < A

      HREF="Javascript:click_link('http://www.tgplay.com');">http://ww

      w.tgplay.com< /A>
      < BR>
      < A

      HREF="Javascript:click_link('http://www.gofuckyourself.com');">h

      ttp://www.gofuckyourself.com< /A>
      < BR>
      < BR>
      courtesy of XXXManager.com ;)
      < /BODY>
      < /HTML>

      Comment

      • Alky
        Confirmed User
        • Apr 2002
        • 5651

        #4
        thanks a lot

        Comment

        • XXXManager
          So Fucking Banned
          • Mar 2002
          • 893

          #5
          U R welcome
          If anybody else have a question...

          Comment

          Working...