title: Why Won't My JavaScript / JSON Script Work In Internet Explorer?
body: <p>I have this code that pre-fills my website with user's city &amp; state based off of a zip-code that is entered into my contact form.   </p>
  
  <p>It works perfect in Google Chrome, and Firefox, but it is not working in IE.   </p>
  
  <p>Does anyone know why, and if so, can you fix the code for me?</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!--Realtime City/State Update From Zip Code Post-in--&gt;
  &lt;script&gt;
      $(document).ready(function () {
          var zip = $("#zip").val();
          $.getJSON('http://zip.elevenbasetwo.com/v2/US/' + zip, function (json) {
              $('#city').val(json.city);
          });
          $.getJSON('http://zip.elevenbasetwo.com?zip=' + zip, function (json) {
              $('#state').val(json.state);
          });
      });
  &lt;/script&gt;
  &lt;!--On Edit/Keyup City/State Update--&gt;
  &lt;script&gt;
      $(document).on("keyup", "#zip", function () {
          var zip = this.value;
          $.getJSON('http://zip.elevenbasetwo.com/v2/US/' + zip, function (json) {
              $('#city').val(json.city);
          });
          $.getJSON('http://zip.elevenbasetwo.com?zip=' + zip, function (json) {
              $('#state').val(json.state);
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Edit</strong><br>
  What I mean by <code>not working</code> is that on Google Chrome and Firefox my City &amp; State fields in my contact form will automatically be pre-filled based on the zip-code that is entered.   </p>
  
  <p>However in IE (version 9 for me), the City &amp; State fields are not pre-populating like they should.</p>