I have a javascript file that I reference in HTML with standard <script src="foo.js?param"></script>. In the file I want to distinguish e.g. loading the file with foo.js from foo.js?auto and foo.js?noauto=true, but not if the file is renamed to bar.js and referenced with the same parameter. How can I accomplish this, preferably not using any framework?
I have a javascript file that I reference in HTML with standard <script src=foo.js?param></script>
Share
Take a look a scriptaculous’ approach:
I think it runs through all script elements and finds the reference to itself, and then parses that URL.