navigator.notification.alert单元测试javascript
这是我的密码navigator.notification.alert单元测试javascript,javascript,notifications,qunit,Javascript,Notifications,Qunit,这是我的密码 navigator = { notification: function(text, function() {}, title, buttonName){ alert("Cleared!"); } }; 我得到一个函数错误。我也尝试过空引号和null。似乎都不管用。有什么想法吗 navigator = { notification: function(text, title, buttonName){ alert("Clea
navigator = {
notification: function(text, function() {}, title, buttonName){
alert("Cleared!");
}
};
我得到一个函数错误。我也尝试过空引号和null。似乎都不管用。有什么想法吗
navigator = {
notification: function(text, title, buttonName){
alert("Cleared!");
}
};
上面的代码应该工作得更好。在函数定义中,必须在左括号和右括号之间列出变量名。在代码示例中,您使用了函数文本
我还建议使用开发者工具栏,比如Chrome开发者工具来帮助您调试JavaScript
祝你好运