Get the URL of the file where is declared the function
<p>I can't find anything on the web.
The keyword I used all give me more traditional answers.</p>

<p>I am working on an embeder for a Flash file.
I want to have a folder with the flash file and the javascript code to embed it properly.</p>

<p>My question is, how do I get the path to my Flah file?
I have the relative URL from the js file, but if I make a request from the js it will take the URL of the html page, right?</p>

<p>In Flash, the behaviour is the same, but you can get the url where the SWF file is hosted.
I this it also exists with PHP.
How do you do that with a javascript file?</p>

<p>I know I must have the URL in the HTML anyhow, since I load the js file.
And I can send it to the function I call as a parameter.
But I am trying to make it as simple as possible to instal, so if this function exist I'd like to know of it.</p>

<p>Thanks.</p>

<p>EDIT:</p>

<p>Finaly, I used some PHP, who can locate himself easily using $_SERVER["PHP_SELF"], to add some parameter to a javascript file.</p>

<p>You embed the PHP request the same way you would a javascript file.</p>



<p>Works like a charm.</p>
