Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
use jquery ajax function over get (#3495)
Browse files Browse the repository at this point in the history
* use jquery ajax function over get

* update json data type and remove stale comment
  • Loading branch information
bbraithwaite authored and jagtalon committed Mar 9, 2018
1 parent 1af8951 commit bd5f2ea
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions share/spice/currency/currency.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,14 @@
}

var endpoint = "/js/spice/currency/1/" + from + "/" + to;
$.get(endpoint, function(payload) {

// jsonp is returned from the API so we have to alter the contents
var response = JSON.parse(payload.trim().replace(/^[^\(]*\(/, '').replace(/\);$/, ''));
response = response.conversion;
Converter.resetConverter(response);

$.ajax({
url: endpoint,
dataType: 'json',
success: function(payload) {
var response = JSON.parse(payload.trim().replace(/^[^\(]*\(/, '').replace(/\);$/, ''));
response = response.conversion;
Converter.resetConverter(response);
}
});
},

Expand Down

0 comments on commit bd5f2ea

Please sign in to comment.