Extract GET Params from a JavaScript Script Tag

1 · James Smith · June 12, 2010, midnight
Here’s a simple trick to extracting HTTP GET style parameters from a <script> tag, from within the script itself. Motivation At Heyzap, we create a variety of games widgets that publishers can embed on their sites to instantly get great game content. Publishers can choose which games appear on their widget by supplying a custom “embed key” to the widget. Typically, you’d supply extra context to a javascript embed as follows: <script type="javascript" src="http://www.blah.com/myscript.js"></scrip...