title: JSON Request appended with [object%20Object] in jQuery
body: <p>I'm trying to fetch a custom JSON feed I have written with jQuery using the <code>getJSON</code> method.  For an unknown reason the URL seems to be having <code>cache_gen.php?location=PL4</code> stripped from the end and replaced with [object%20Object] resulting in a 404 error occurring. </p>
  
  <p>Here's the jQuery I'm using:</p>
  
  <pre><code>var fetchData = function() {
  
      if (Modernizr.localstorage) {
  
          var api_location = "http://weatherapp.dev/cache_gen.php";
          var user_location = "PL4";
          var date = new Date();
  
          console.log(api_location + '?location=' + user_location);
  
          jQuery.getJSON({
              type: "GET",
              url: api_location + '?location=' + user_location,
              dataType: "json",
              success: function(jsonData) {
                  console.log(jsonData);
              }
          });
  
      } else {
          alert('Your browser is not yet supported.  Please upgrade to either Google Chrome or Safari.');
      }
  }
  
  fetchData();
  </code></pre>
  
  <p>From the console log I can see the URL string is calculated correctly as: <code>http://weatherapp.dev/cache_gen.php?location=PL4</code></p>
  
  <p>However the second line in the console is: <code>Failed to load resource: the server responded with a status of 404 (Not Found)</code>.  </p>
  
  <p>Can anyone point me in the right direction with this?</p>
  
  <p><strong>UPDATE 19/01/2013 23:15</strong></p>
  
  <p>Well, I've just converted so that is fits the docs perfectly using <code>$.ajax</code>.  I've also added a fail event and logged all of the data that gets passed to it.  </p>
  
  <pre><code>var fetchData = function() {
  
      if (Modernizr.localstorage) {
  
          var api_location = "http://weatherapp.dev/cache_gen.php";
          var user_location = "PL4";
          var date = new Date();
  
          var url = api_location + '?location=' + user_location;
  
          console.log(url);
  
          jQuery.ajax({
              type: "GET",
              url: api_location + '?location=' + user_location,
              dataType: "json",
              success: function(jsonData) {
  
                  console.log(jsonData);
              },
              error: function( jqXHR, textStatus, errorThrown ) {
                  console.log('textStatus: ' + textStatus );
                  console.log('errorThrown: ' + errorThrown );
                  console.log('jqXHR' + jqXHR);
              }
          });
  
      } else {
          alert('Your browser is not yet supported.  Please upgrade to either Google Chrome or Safari.');
      }
  }
  
  fetchData();
  </code></pre>
  
  <p>After this my console gives me the following information:</p>
  
  <pre><code>http://weatherapp.dev/cache_gen.php?location=PL4
  download_api.js:44textStatus: parsererror
  download_api.js:45errorThrown: SyntaxError: JSON Parse error: Unable to parse JSON string
  download_api.js:46jqXHR[object Object]
  </code></pre>
  
  <p>I have ensured the headers for the JSON feed are current, and the feed is definitely serving valid JSON (it effectively caches a 3rd party service feed to save costs on the API).  </p>