title: Why does this dropdown list for sorting work in Internet Explorer but not in Chrome?
body: <p>I have some JavaScript for a dropdownlist to sort results on a product inventory page. In Internet Explorer the sorting works fine and the browser handles this perfect. However in Chrome it fails every time (can you believe it, something works in IE but not Chrome?) </p>
  
  <p>In IE when I use the Sort By option the URL looks like this:</p>
  
  <blockquote>
    <p>MyExampleSite.com/Supplies/Products/12345/MyProduct/?a=0</p>
  </blockquote>
  
  <p>However when I do the Sort By option in Chrome here is what the URL looks like:</p>
  
  <blockquote>
    <p>MyExampleSite.com/Supplies/Products/12345/MyProduct/?<strong>&amp;amp</strong>;a=0</p>
  </blockquote>
  
  <p>As you can see it adds the amp in the URL, and if I keep trying to sort it just add's an additional amp everytime.</p>
  
  <p>Here is the JavaScript which caused my issues: </p>
  
  <pre><code>    $("[name=a]").change(function () {    
          window.location = '@(this.Model.SortUri)' + '@(this.Model.SortUri.IndexOf('?') == -1 ? "?" : "&amp;")a=' + this.value;
      });
  </code></pre>
  
  <p>My Solution was to add <code>Html.Raw</code> like this:</p>
  
  <pre><code>    $("[name=a]").change(function () {
          window.location = '@(this.Model.SortUri)' + '@Html.Raw(this.Model.SortUri.IndexOf('?') == -1 ? "?" : "&amp;")a=' + this.value;
      });
  </code></pre>
  
  <p>And suddenly it works fine in IE and Chrome. </p>
  
  <p>My question is why did Chrome do this but not IE?</p>