function handleLupGoBrowseResponse(response){
if(response.productType == "MSG"){
if(LOCALE == 'en_US'){
$('p.success').html(lupSuccessEn);
$(lupUpsellEn).insertAfter('.headerTopBar');
//alert("yes"); remove for prod
}else if(LOCALE == 'fr_CA'){
$('p.success').html(lupSuccessFr);
$(lupUpsellFr).insertAfter('.headerTopBar');
}else if(LOCALE == 'ja_JP'){
$('p.success').html(lupSuccessJp);
$(lupUpsellJp).insertAfter('.headerTopBar');
}
}else{
//alert("no"); remove for prod
//alert(lupMobile); remove for prod
}
}
if(lupAjaxUrl != ""){
$.ajax({
url: lupAjaxUrl,
cache: false,
pageCache: false,
dataType: "jsonp",
success: handleLupGoBrowseResponse
});
}
答案 0 :(得分:2)
您的ajax调用的响应不是对象,它被评估为null。在函数的开头添加一个条件来测试该值
function handleLupGoBrowseResponse(response){
if(response) {
// execute your code
} else {
console.log(response);
}
}