Unobtrusive Javascript
2015-09-29 22:03
525 查看
Unobtrusive Javascript有三层含义:一是在HTML代码中不会随意的插入Javsscript代码,只在标签中加一些额外的属性值,然后被引用的脚本文件识 别和处理;二是通过脚本文件所增加的功能是一种渐进式的增强,当客户端不支持或禁用了Javsscript时网页所提供的功能仍然能够实现,只是用户体验 会降低;三是能够兼容不同的浏览器。
可以看到魔力就在于以data-ajax开头的一些属性中,当Javascript被禁用后,表单仍能提交,链接也能点开,只不过不再是异步的了。
Built-in validator controls have been configured to use unobtrusive JavaScript for client-side validation logic. This significantly reduces the amount of JavaScript rendered inline in the page markup and reduces the overall page size. Unobtrusive validation is added globally to the ASP.NET Web Forms Application template based on the setting in the <appSettings> element of the Web.config file at the root of the application.
可以看到魔力就在于以data-ajax开头的一些属性中,当Javascript被禁用后,表单仍能提交,链接也能点开,只不过不再是异步的了。
Built-in validator controls have been configured to use unobtrusive JavaScript for client-side validation logic. This significantly reduces the amount of JavaScript rendered inline in the page markup and reduces the overall page size. Unobtrusive validation is added globally to the ASP.NET Web Forms Application template based on the setting in the <appSettings> element of the Web.config file at the root of the application.
相关文章推荐
- 如何正确学习JavaScript
- js鼠标跟随移动显示表格上某一行的信息(包括表格外的信息)
- 第一章JSP基础语法
- JavaScript中简单的数组使用及明细处理
- JavaScript高级程序设计之函数表达式之闭包第7.2讲笔记
- [JavaScript权威指南 [笔记]
- 用js将二维数组转为json格式字符串
- Chrome 控制台console的用法(学了之后对于调试js可是大大有用)
- 【js】day01_JS概述_Js特点_使用JS_调试
- JSP中forward和redirect的区别
- 【前端学习】javascript正则表达式和字符串RegExp and String(一)
- 用Servlet处理表单提交的数据,然后再jsp页面中显示
- JavaScript 通过ClassName获取元素
- JavaScript 控制元素隐藏显示
- JS获得鼠标位置(已经解决不同浏览器问题)
- JS如何判断包括IE11在内的IE浏览器
- 妙味js视频学习之旅(二)
- Jasmine: JavaScript 单元测试框架
- 对json进行封装
- jsp与servlet的联系