Clean GET params in ajax calls
- Use `data` arg of `$.getJSON` for `format` param - Delete `dictToArray` call on data returned by `SingleResumeStat` class view since this view now returns stats manifest as an array
This commit is contained in:
parent
1ee993e1e1
commit
df7e935390
1 changed files with 3 additions and 4 deletions
|
@ -42,8 +42,7 @@
|
||||||
$(this).addClass("focus");
|
$(this).addClass("focus");
|
||||||
|
|
||||||
// loads data and shows it
|
// loads data and shows it
|
||||||
$.getJSON(this.stats_target_url + "?format=json",
|
$.getJSON(this.stats_target_url, {format: 'json'}, displayStats);
|
||||||
displayStats);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayStats (data) {
|
function displayStats (data) {
|
||||||
|
@ -158,7 +157,7 @@
|
||||||
"aria-label": "select-period"});
|
"aria-label": "select-period"});
|
||||||
|
|
||||||
var to_click;
|
var to_click;
|
||||||
var context = dictToArray(data.stats);
|
var context = data.stats;
|
||||||
|
|
||||||
for (var i = 0; i < context.length; i++) {
|
for (var i = 0; i < context.length; i++) {
|
||||||
// creates the button
|
// creates the button
|
||||||
|
@ -191,7 +190,7 @@
|
||||||
|
|
||||||
// constructor
|
// constructor
|
||||||
(function () {
|
(function () {
|
||||||
$.getJSON(url + "?format=json", initialize);
|
$.getJSON(url, {format: 'json'}, initialize);
|
||||||
})();
|
})();
|
||||||
};
|
};
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
Loading…
Reference in a new issue