首页 > 移动平台 > 详细

Vs2013 html5开发WP8.1 APP之alert

时间:2015-04-21 14:30:58      阅读:203      评论:0      收藏:0      [点我收藏+]

Js的alert不被支持

使用

navigator.notification.alert

需要在CONFIG中增加

技术分享

?

?

示例

?

  1. <script type="text/javascript">
  2. ????????function showAlert() {
  3. ????????????navigator.notification.alert(
  4. ????????????????‘You are the winner!‘, // message
  5. ????????????????null, // callback
  6. ????????????????‘Game Over‘, // title
  7. ????????????????‘Done‘ // buttonName
  8. ????????????);
  9. ????????};
  10. ????????function testStorage() {
  11. ????????????if (window.localStorage) {
  12. ????????????????navigator.notification.alert(‘浏览器支持localStorage‘, showAlert, "Config", "OK");
  13. ????????????} else {
  14. ????????????????navigator.notification.alert("浏览器暂不支持localStorage", null, "Config", "OK");
  15. ????????????}
  16. ????????????if (window.sessionStorage) {
  17. ????????????????navigator.notification.alert("浏览器支持sessionStorage", null, "Config", "OK");
  18. ????????????} else {
  19. ????????????????navigator.notification.alert("浏览器暂不支持sessionStorage",null,"Config","OK")
  20. ????????????}
  21. ????????}
  22. ????</script>

?

效果

?

技术分享

?

?

技术分享

?

?

技术分享

?

?

Vs2013 html5开发WP8.1 APP之alert

原文:http://www.cnblogs.com/QinQouShui/p/4444186.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!