In mytest.html I include this:
<html><head>
<script type="text/javascript" src="/myjavascript.js?foo=bar"></script>
</head>
<body>Hi</body>
</html>
In the myjavascript.js
alert(this.location.search);
This shows the query string mytest.html but I want query string of the javascript itself "foo=bar" or just "bar".
Any ideas as to how to do this would be great. (I am thinking maybe I need to read the html for script element and parse that text. But I am hoping this is an easier way.)
I can use JQuery to do this as well if there is an easy way.