我有这个GLOBAL功能在Android的Phonegap桌面应用程序或Chrome Mobile中无效,它仅适用于Chrome PC版本...我使用onClick事件调用此函数,#suich
是一个开关复选框SVG
function setPush() {
var nick_ = window.localStorage.getItem("username");
var notify = window.localStorage.getItem("option");
$.ajax({
type: "POST",
url: "push_set.php",
data: ({
nick: nick_,
opcion: notify
}),
cache: false,
dataType: "json",
success: function(data) {
if (data.status == 'success') {
if (notify == 1) {
myApp.alert('Notifications disabled', 'Notice:');
$('#suich').prop('checked', false);
} else {
myApp.alert('Notifications enabled', 'Notice:');
$('#suich').prop('checked', true);
}
} else if (data.status == 'error')
alert('Connection problems', 'Warning:');
}
});
};
答案 0 :(得分:2)
尝试输入完整的网址而不是
url: "push_set.php"
像
url: "www.yourdomain.com/push_set.php"