Success function for init Jquery Call

核能气质少年 提交于 2021-02-11 14:26:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!