问题
I have setup an call on /KbAuthToken.php endpoint, i am returning data from that endpoint i.e (/KbAuthToken.php).
I am not sure how to console log that returned data. How to add success function in the below js ?
jQuery(document).ready(function() {
// <![CDATA[
document.addEventListener("KitBuilderLoaded", function() {
KitBuilder.init('#kitBuilder', {
auth: {
// Kit Builder calls this URL that returns a JWT for the current user
genericJwtUrl: '/KbAuthToken.php',
// Kit Builder runs these when you click Login or Log out
logIn: function() {
location.href = '/login';
},
logOut: function() {
location.href = '/logout';
},
},
cartItemPricingMethod: 'SimpleTieredPricing',
currencySymbol: '$'
});
});
jQuery.ajax(genericJwtUrl).done(function(response) {
console.log(response);
});
});
来源:https://stackoverflow.com/questions/65474658/success-function-for-init-jquery-call