I'm trying to do an AJAX GET. var q_url = window.location.toString(); $.ajax({ type: 'GET', url: q_url, cache: false, dataType: 'json', success: function(response, textStatus) { ... }, error: function (xhr, textStatus, errorThrown) { alert(textStatus); } });
This triggers the error callback with textStatus == "parseerror". If I hardcode q_url, everything works. Stepping through with Firebug shows that q_url has the same value no matter if it's hardcoded or set via window.location.toString() (or window.location.href or window.location.pathname, which are all supposed to be strings according to https://developer.mozilla.org/En/DOM/Window.location ). The browser is Firefox 3.0.11. Any ideas? A separate issue is that no matter whether the GET succeeds or fails, instead of going to q_url, it goes to a url like q_url + '? _=1245297612818' (according to Firebug 1.3). What gives?