0
的PhoneGap或科爾多瓦通知,骨幹不工作,要求和JavaScript。PhoneGap的通知不工作
所以情況是,如果用戶名和密碼是空的,應該(使用PhoneGap的)通知,但它不會工作。有任何想法嗎?
我有這樣的代碼
define([
'jquery',
'backbone',
'underscore',
'base64',
'mobile',
'cordova',
'const',
'text!template/login/login.tpl.html'
],function($, Backbone, _, base64, Mobile, Cordova, Const, template){
if(!Const.USERNAME || !Const.PASSWORD)
{
navigator.notification.alert("Invalid Username/Password!");
$("input").val("");
}else{
var auth = EncodeAuth(Const.USERNAME,Const.PASSWORD);
var sendAuthorization = function (xhr) {
xhr.setRequestHeader('Authorization', auth)
};
this.model.save(this.model, {
beforeSend : sendAuthorization,
success: function(model,result){
if(result.ErrorMessage === null)
{
alert(JSON.stringify(result.Message));
$("input").val("");
}
else
{
alert(JSON.stringify(result.ErrorMessage));
$("input").val("");
}
},