how should i reference a php file from an external javascript file -


so general question: if have file structure have index page in root folder along scripts folder, , in scripts folder there 2 scripts 1 js referenced in index page, , other php referenced js script:

root-folder:
--> index.html
--> scripts/
-----> myscript.js
-----> myscript.php

how should access php script js script using relative url?

would be: ./myscript.php or ./scripts/myscript.php

in other words relative url index file or js file. thanks!

since javascript operating in scope of page, not physical location, url php include /scripts/ in path name.


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -