Reputation: 53
I need someone to enlighten me. I've seen this:
<script src="http://host.com/file.js?no_forms=1"></script>
What does that means? A GET parameter passed to a javascript file? Into which conditions this can be done? What kind of approach is this?
Any help would be appreciated.
Upvotes: 3
Views: 149
Reputation: 49095
Sometimes the parameter is used simply to prevent client side caching.
It could also be that requesting file.js
is actually rewritten as a dynamic call (say script.php?file=file.js&no_forms=1
) that is fetching the correct file and using the extra parameter somehow.
Upvotes: 2
Reputation: 482
You can use this
<script src="http://host.com/file.js" no_forms="1"></script>
And
function $_GET(q,s) {
s = s || window.location.search;
var re = new RegExp('&'+q+'=([^&]*)','i');
return (s=s.replace(/^\?/,'&').match(re)) ? s=s[1] : s='';
}
And get result
var noForms = $_GET('no_forms');
Upvotes: 0
Reputation: 15861
?no_forms=1
is just a query string parameters. i will just tell the common usage of such things.
Upvotes: 5