in reply to Re: How to detect which page loaded script
in thread How to detect which page loaded script

Someone told me JS could do this, unfortunately I don't know how to pass the information.

They said window.location would hold the URL. Anyone know how to get a javascript to pass this to my script?

  • Comment on Re^2: How to detect which page loaded script

Replies are listed 'Best First'.
Re^3: How to detect which page loaded script
by phaylon (Curate) on Dec 07, 2005 at 19:19 UTC
    You still haven't said what you're up to. There may be possibilities with javascript, but what if it's disabled/not working/faked?

    Ordinary morality is for ordinary people. -- Aleister Crowley
      Hi.

      Sorry. This is for a users online script. It shows the number of users online just fine but I want an admin log to see where people are RIGHT NOW. It shows the IP addy and the URL of the page each visitor to the site is on right now.

      If JS is disabled and nothing gets passed to the script, no big deal. But it would work for most people and that's definitely good enough.

        If it's not that important, why isn't simply the referer enough? It also works "most of the time," it's just not reliable. And you wouldn't have to run scripts.

        Personally, I'd just look what resources where called by which user in the last 30 (or something) seconds. Also I have to apologize, but I'm a loser in javascript.

        Ordinary morality is for ordinary people. -- Aleister Crowley