Preventing URL string from being encoded in JavaScript
<p>I'm not very good at JavaScript and have some code that was written for me:</p>

<pre><code>if (args[2].LocationCacheTypeID == 1) {
  locationInput.name = 'Cities';
</code></pre>

<p>I'd like to add <code>LinkID=27201&amp;</code> to the code as seen below:</p>

<pre><code>if (args[2].LocationCacheTypeID == 1) {
  locationInput.name = 'LinkID=272081&amp;Cities';
</code></pre>

<p>The only problem is that when I add it and it's turned into a URL string the result is:</p>

<pre><code>?LinkID%3D272081%26Cities=Poquoson
</code></pre>

<p>It turns the <code>=</code> to <code>%3D</code> and the <code>&amp;</code> to <code>%26</code>.</p>

<p>How can I fix this?</p>

<p>The full original script is:</p>

<pre><code>&lt;script type='text/javascript'&gt;
(function() {
  var dataSource = new YAHOO.util.ScriptNodeDataSource('http://api.idx.diversesolutions.com/API/Locations/33266/81?');
  var ac = new YAHOO.widget.AutoComplete('vrcsf_location', 'vrcsf_location_ac', dataSource);

  dataSource.responseSchema = {
    resultsList: '',
    fields: ['LocationName','LocationCacheTypeID','TotalCount']
  };

  ac.animVert = false;
  ac.queryMatchContains = true;
  ac.queryQuestionMark = false;
  ac.useShadow = true;
  ac.queryDelay = .1;
  ac.typeAhead = false;
  ac.allowBrowserAutocomplete = false;
  ac.alwaysShowContainer = false;
  ac.resultTypeList = false;
  ac.maxResultsDisplayed = 5;
  ac.resultTypeList = false;

  ac.generateRequest = function(query) {
    return 'partialName=' + query + '&amp;maxAreasToReturn=5';
  };

  ac.formatResult = function(resultData, query, resultMatch) {
    var type;

    if (resultData.LocationCacheTypeID == 1) {
      type = 'City';
    } else if (resultData.LocationCacheTypeID == 2) {
      type = 'Community';
    } else if (resultData.LocationCacheTypeID == 3) {
      type = 'Tract';
    } else if (resultData.LocationCacheTypeID == 4) {
      type = 'Zip';
    } else if (resultData.LocationCacheTypeID == 5) {
      type = 'County';
    }
    return (resultMatch + ' (' +  type + ')');
  };

  ac.itemSelectEvent.subscribe(function(e, args) {
    var locationInput = YAHOO.util.Dom.get('vrcsf_location');

    if (args[2].LocationCacheTypeID == 1) {
      locationInput.name = 'Cities';
    } else if (args[2].LocationCacheTypeID == 2) {
      locationInput.name = 'Communities';
    } else if (args[2].LocationCacheTypeID == 3) {
      locationInput.name = 'Tracts';
    } else if (args[2].LocationCacheTypeID == 4) {
      locationInput.name = 'ZipCodes';
    } else if (args[2].LocationCacheTypeID == 5) {
      locationInput.name = 'Counties';
    }
  });
})();
</code></pre>

<p></p>
