Taking the result from a function and adding it to a javascript
<p>I am using a JavaScript that reads the URL and parses the parameters.  The JavaScript works just fine when I add a document.write to the body of the page.  I am trying to take a parameter value and populate it into a Google JavaScript for ad serving.  It would be ideal to take the parameter 'fire' from the 'frank' variable and replace it with 'VALUE' located in this JS: <code>GA_googleAddAttr("ad_key", "VALUE");</code>.</p>

<p>I feel as though I am missing something taking the result from the first JS and making it available for placement in the Google JS.</p>

<p>Any help will be greatly appreciated.  Thank in advance.</p>

<p>Example URL:  <a href="http://www.example.com/test.html?frank=fire" rel="nofollow">http://www.example.com/test.html?frank=fire</a></p>

<p>------------ JavaScript:  get url parameter ------------</p>

<pre><code>&lt;script type="text/javascript"&gt;

function gup( name ){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&amp;]"+name+"=([^&amp;#]*)";
var regex = new RegExp( regexS );
var results = regex.exec( window.location.href );
if( results == null )    return "";
else    return results[1];}

var frank_param = gup( 'frank' );

&lt;/script&gt;
</code></pre>

<p>------------ JavaScript:  google ad serving attribute ------------</p>

<pre><code>&lt;script type="text/javascript"&gt;
GA_googleAddAttr("ad_key", "VALUE");
&lt;/script&gt;
</code></pre>

<p>ad_key = Added within the Google DFP ad serving platform</p>

<p>VALUE = Used for targeting ads for a specific page</p>

<hr>
