Is this javascript encoding properly written?
<p>I have tried some tips I was given on regards URL encoding but I have no success so far. First, I was given this format, </p>

<pre><code>var url = "http://www.polyvore.com/cgi/add?title=" 
      + encodeURIComponent(%%GLOBAL_ProductName%%) 
      + "&amp;url=" + encodeURIComponent("http://lilaboutique.co.uk/products/" 
          + encodeURIComponent(%%GLOBAL_ProductName%%) 
          + "&amp;imgurl=" + encodeURIComponent(%%GLOBAL_ThumbImageURL%%) 
          + "&amp;desc=" + encodeURIComponent(%%GLOBAL_ProductDesc%%) 
          + "&amp;price=" + encodeURIComponent(%%GLOBAL_ProductPrice%%));
</code></pre>

<p>which never got to be passed to the href dunno for what reason. Then I played with it some more, </p>

<pre><code>var url = "http://www.polyvore.com/cgi/add?title=encodeURIComponent(%%GLOBAL_ProductName%%)&amp;url=http://lilaboutique.co.uk/products/encodeURIComponent(%%GLOBAL_ProductName%%)&amp;imgurl=encodeURIComponent(%%GLOBAL_ThumbImageURL%%)&amp;desc=encodeURIComponent(%%GLOBAL_ProductDesc%%)&amp;price=encodeURIComponent(%%GLOBAL_ProductPrice%%)";
</code></pre>

<p>this time the url was passed but the values were mixed between the appropriate and other fields displaying the encoding function itself. </p>

<p>Any help clarifying my mistakes is greatly appreciated. I would like to encode just price and description, seems to be the fields giving problems. </p>

<p>A regular link does render without problems</p>

<pre><code>var url = "www.google.com";

var myAnchor = document.getElementById('myAnchor');

myAnchor.href = url;
</code></pre>

<p>Thanks for any help</p>
