krusty has asked for the wisdom of the Perl Monks concerning the following question:

If I have an html file with a <script> tag is there a way to pass the name and the included parameters of the calling URL?

Thanks,
Kristina

20050203 Edit by castaway: Changed title from 'how to pass the URL itself to an embedded script'

  • Comment on (OT) how to pass the URL itself to an embedded script

Replies are listed 'Best First'.
Re: (OT) (OT) how to pass the URL itself to an embedded script
by ikegami (Patriarch) on Jan 28, 2005 at 22:45 UTC

    IE's DHTML/DOM is documented here.

    The document object has a URL property, which would include GET arguments, but not POST arguments.

    If you need POST arguments, the arguments could be included in the generated page as hidden fields (i.e. <input type="hidden" name="name" value="value">). Then your script can get the value of those hidden fields.

Re: (OT) how to pass the URL itself to an embedded script
by traveler (Parson) on Jan 29, 2005 at 16:46 UTC
    Hello, krusty! The URL of a document is object.LocationURL. You can then pass that to the script.