从JQUERY调用页面方法无法在Safari中工作 [英] Calling page method from JQUERY not working in 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屋!