0

I have the following code snip and am trying to debug it. Is there a way to get the full url string that the .getJSON call is calling?

opts = {};
opts['start'] = startdate;
opts['end'] = enddate;
opts['email'] = addresses;
$.getJSON(url_count_string, opts, function(data){
   drawChart(data, chartsData['hourChart']);
});
Kris Krause
  • 7,304
  • 2
  • 23
  • 26
locoboy
  • 38,002
  • 70
  • 184
  • 260

3 Answers3

2

Firefox w/Firebug - "Net" tab.

Chrome - "Network" tab.

IE9 - "Network" tab.

Safari - "Network" tab.

Opera - Dragonfly "Network" tab.

Kris Krause
  • 7,304
  • 2
  • 23
  • 26
0

if your url_count_string is relative & what you want to see if full url, then append url_count_string to current path.

If what you want to see is url with request params appended (x=123&y=456....), try to see XHR Net Panel in Firebug.

kdabir
  • 9,623
  • 3
  • 43
  • 45
0

You know that the method is making a GET request, so it must be appending the data in the standard way.

Using this answer, we can do this:

function createGetParams(data) {
  var ret = [];
  for (var d in data) {
    ret.push(encodeURIComponent(d) + "=" + encodeURIComponent(data[d]));
  }
  return ret.join("&");
}

var finalURL = url_count_string + '?' + createGetParams(opts);

Assuming the opts array and url_count_string variables are defined as they are in your question.

finalURL will be the URL that jQuery is sending the request to.

Community
  • 1
  • 1
Alex
  • 9,313
  • 1
  • 39
  • 44