Js的alert不被支持
使用
navigator.notification.alert
需要在CONFIG中增加
示例
- <script type="text/javascript">
- function showAlert() {
- navigator.notification.alert(
- 'You are the winner!', // message
- null, // callback
- 'Game Over', // title
- 'Done' // buttonName
- );
- };
- function testStorage() {
- if (window.localStorage) {
- navigator.notification.alert('浏览器支持localStorage', showAlert, "Config", "OK");
- } else {
- navigator.notification.alert("浏览器暂不支持localStorage", null, "Config", "OK");
- }
- if (window.sessionStorage) {
- navigator.notification.alert("浏览器支持sessionStorage", null, "Config", "OK");
- } else {
- navigator.notification.alert("浏览器暂不支持sessionStorage",null,"Config","OK")
- }
- }
- </script>
效果