Quote:
Originally Posted by hno2005
Hi every one
I need to send an id to a JavaScript file . this is my code :
<script src="test.js" language="javascript" ></script>
I want to post data , something like this :
<script src="test.js?id=5" language="javascript" ></script>
is it possible ?
How can I send an id to a javascript file ?
Thanks
|
Not possible. (Why do you want to do that??) JavaScript running in the browser does not have any commands for reading or writing files. In any case for security reasons JavaScript cannot access anything beyond the domain of the current page. This is known as the "same origin policy" and prevents a document or script loaded from one origin from getting or setting properties of a document from a different origin.
Be aware that script language="javascript" is long obsolete.
St.John the blacksmith dumped water on his head.
- Pupil's answer to Catholic Elementary School test.