Unobtrusive Javascript

  1. Unobtrusive Javascript有三層含義:一是在HTML代碼中不會隨意的插入Javsscript代碼,只在標籤中加一些額外的屬性值,而後被引用的腳本文件識 別和處理;二是經過腳本文件所增長的功能是一種漸進式的加強,當客戶端不支持或禁用了Javsscript時網頁所提供的功能仍然可以實現,只是用戶體驗 會下降;三是可以兼容不一樣的瀏覽器。
  2. 能夠看到魔力就在於以data-ajax開頭的一些屬性中,當Javascript被禁用後,表單仍能提交,連接也能點開,只不過再也不是異步的了。
  3. 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.
相關文章
相關標籤/搜索