Pass URL into JS function
<p>I have a PHP page with where I also use jQuery UI functionality. User drags Item from left panel into a box on the right. After it is dropped a dialog appears. If user clicks the first button he/she is redirected to a URL. I need to be able to change URL based on a user.</p>

<p>I can get the URL into a var or $_SESSION but I can't figure out how do I change it inside my JS function?</p>

<p>Here's the <a href="http://www.c8r.us/uxSpQuP" rel="nofollow">DEMO</a> (drop item into box to get dialog).</p>

<hr>

<p>UPDATE:</p>

<p>Below are all valid suggestions, however, my problem is that I have most of JS functions in external JS file (dragdrop-client.js). </p>

<p>I have added new var to my main PHP file </p>

<pre><code>var endURL = "http://google.com";
</code></pre>

<p>but how do make my function checkLaunchpad() use it?</p>
