从JQUERY调用页面方法无法在Safari中工作 [英] Calling page method from JQUERY not working in Safari

查看:114
本文介绍了从JQUERY调用页面方法无法在Safari中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调用JQUERY的页面方法,它在Chrome和Firefox中工作正常但是在Safari中不起作用,有人可以帮忙吗?



< pre lang =Javascript> function setVariables(city,area,date,pooja,isInstant){

$ .ajax({
类型: POST
url: Default.aspx / setVariables
data: < span class =code-string> {city:' + city + ',area: ' + area + ',date:' + date + ',pooja:' + pooja + ',isInstant:' + isInstant + '}
contentType: < span class =code-string> application / json; charset = utf-8,
dataType: json
成功:OnsetVariablesSuccess,
失败:功能(响应){

}
});
}

function OnsetVariablesSuccess(response){


if (response.d == 1 ){

}


}

解决方案

.ajax({
type: POST
url: Default.aspx / setVariables
data: {city:' + city + ',area:' + area + ',date:' + date + ',pooja:' + pooja + ',isInstant:' + isInstant + '}
contentType: application / json; charset = utf-8
dataType: json
成功:OnsetVariablesSuccess,
失败:功能(响应){

}
});
}

function OnsetVariablesSuccess(response){


if (response.d == 1 ){

}


}


I am calling a page method from JQUERY which is working fine in Chrome and Firefox however it doesn't work in Safari, can anyone please help?

function setVariables(city, area, date, pooja, isInstant) {
    
    $.ajax({
        type: "POST",
        url: "Default.aspx/setVariables",
        data: "{city: '" + city + "',area:'" + area + "',date: '" + date + "', pooja: '" + pooja + "',isInstant:' " + isInstant + "'}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: OnsetVariablesSuccess,
        failure: function (response) {
           
        }
    });
}

function OnsetVariablesSuccess(response) {

   
    if (response.d == 1) {
      
    }


}

解决方案

.ajax({ type: "POST", url: "Default.aspx/setVariables", data: "{city: '" + city + "',area:'" + area + "',date: '" + date + "', pooja: '" + pooja + "',isInstant:' " + isInstant + "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: OnsetVariablesSuccess, failure: function (response) { } }); } function OnsetVariablesSuccess(response) { if (response.d == 1) { } }


这篇关于从JQUERY调用页面方法无法在Safari中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆