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

Re: Retrieving projected URL using JavaScript or PHP?

Expand Messages
  • emmanuel92130
    ... [...] ... DoSomething function? Since the click happens in your page, wouldn t it work to set a global variable in an onclick handler in your links? Like:
    Message 1 of 2 , Feb 8, 2007
      --- In JavaScript_Official@yahoogroups.com, "Bryan Garaventa" <bryan@...> wrote:
      [...]
      > And a user clicks on a link on that page to go to another site.
      >
      > Is it possible to capture the url of the page that the user is then going to in the
      DoSomething function?

      Since the click happens in your page, wouldn't it work to set a global variable in an onclick
      handler in your links? Like:

      <a href="blah" onclick="projectedURL = 'whateverURL' ; window.location.replace
      ('whateverURL')">click here to visit whatever</a>

      var projectedURL = null

      function DoSomething() {
      alert("you mean you're leaving this page for " + projectedURL + "?")
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.