I'm working on extracting JSON data from my Rest API to display in my application. I'm wondering if the function renderUserState
is being called, as the rest of my code seems to be functioning correctly.
function testSubmit() {
var card = getQueryVariable("select_card");
var action = getQueryVariable("select_action");
var urlGet = "/test/api/getting-ready?cardId=" + card + "&action=" + action;
$.ajax({
type : 'GET',
url : urlGet,
dataType : 'json',
encode : true
}).done(renderUserState);
}
function renderUserState(userState){
$("#gold").text(userState.goldAmount);
}
Any assistance would be greatly appreciated!