Loading ...
Sorry, an error occurred while loading the content.

Re: [JavaScript] How do I tell what link a user clicks on?

Expand Messages
  • rags
    Hi.. An easy way is to pass the target url name as a parameter to a simple function. The following example shows that. Checking the links
    Message 1 of 1 , Oct 4, 2002
    • 0 Attachment
      Hi..

      An easy way is to pass the target url name as a parameter to a simple function.
      The following example shows that.

      <HTML>
      <HEAD>
      <TITLE>Checking the links clicked by the user</TITLE>
      <script language="javascript">
      function checkLinkName(url)
      {
      alert("You are sending to "+url);
      location.href=url;
      }
      </script>
      </HEAD>

      <BODY>
      <a href="javascript:;" onclick="checkLinkName('First.html');return false;">One</a><br>
      <a href="javascript:;" onclick="checkLinkName('Second.html');return false;">Two</a><br>
      <a href="javascript:;" onclick="checkLinkName('Third.html');return false;">Three</a><br>
      <a href="javascript:;" onclick="checkLinkName('Fourth.html');return false;">Four</a><br>
      </BODY>
      </HTML>


      Happy Programming
      Rags
      ----- Original Message -----
      From: bcj_19
      To: javascript_official@yahoogroups.com
      Sent: Friday, October 04, 2002 2:49 AM
      Subject: [JavaScript] How do I tell what link a user clicks on?


      Hi -

      I'm rather new to JavaScript, and I need to know how to tell what the
      destination of a link is when a user clicks on it, before the page is
      unloaded.

      Thanks for any help...

      ~ bcj19 ~


      Yahoo! Groups Sponsor
      ADVERTISEMENT




      To unsubscribe from this group, send an email to:
      javascript_official-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.