Passing JavaScript Parameters via Calling URL
<p>I have a JavaScript file that embeds a widget on a website. I want to be able to call this widget using a URL of the form:</p>

<pre><code>http://domain.com/widget.js?variable=test
</code></pre>

<p>Within the JS script I want to be able to read in the value of the URL parameter 'variable' which is this case is 'test' and use it in the HTML code the JS outputs. I tried using window.location but that is returning the URL of the main webpage and not the URL that is being called to load the script.</p>

<p>Any ideas what the JS code looks like to read in a passed parameter? Thanks in advance!</p>
