HTML6 無 JavaScript 的單頁應用引起一片嘩然

來源:互聯網
上載者:User

HTML6 無 JavaScript 的單頁應用引起一片嘩然

關於 HTML6 意在實現無 JavaScript 的單頁應用,這引起了前端開發社區一片嘩然。請深呼吸,然後繼續下面內容。

W3.org 分享了一個 casual proposal for HTML6 ,這引起了前端社區的激烈爭論。來自前 NSA 僱員和創業企業級 Bobby Mozumder 提交了這份建議,聲稱一個高效能的響應式 Web 體驗無需 JavaScript 支援。

Mozumder 寫道:新興的 Web 應用程式通過 JSON API 載入動態內容,這是單頁應用的一個標準設計模式。大多數人採用這種方法是因為它比載入一個完整 HTML 頁面要節省很多時間。

這種模式使用那麼的廣泛,因此 Mozumder 的建議是未來瀏覽器應該直接提供動態載入內容的功能,而不需要開發人員編寫任何 JavaScript 代碼。

下面是 Mozumder 建議的 HTML 程式碼:

  1. <DOCTYPE html> 
  2. <HTML LANG=“en”> 
  3. <HEAD> 
  4. <FIXTURES lang=“xml”> 
  5.     <model class=“MyArticleData”> 
  6.         <rsp stat=“ok"> 
  7.             <article label=“one” id=“1"> 
  8.                 <headline>"Big News!”</headline> 
  9.                 <body>"<p>This is the first article intro.</p><p>This is the second paragraph.</p>"</body> 
  10.             </article> 
  11.             <article label=“two” id=“2"> 
  12.                 <headline>"Not so big news"</headline> 
  13.                 <body>"<p>This is the <em>second</em> article.</p>"</body> 
  14.             </article> 
  15.         </rsp> 
  16.     </model> 
  17.     <model class=“MyImageData”> 
  18.         <rsp stat=“ok"> 
  19.             <image label="Square" width="75" height="75" source="https://mycontentserver.com/image_s.jpg" id=“3"/> 
  20.             <image label=“Tall" width=“300" height=“200" source="https://mycontentserver.com/image_l.jpg" id=“4"/> 
  21.         </rsp> 
  22.         <rsp stat=“loading"> 
  23.             <image label="Square" width="75" height="75" source="https://mycontentserver.com/loading_image_s.jpg" id=“1"/> 
  24.         </rsp> 
  25.         <rsp stat=“some_error"> 
  26.             <image label="Square" width="75" height="75" source="https://mycontentserver.com/error_image_s.jpg" id=“2"/> 
  27.             <message 
  28.         </rsp> 
  29.     </model> 
  30. </FIXTURES> 
  31. </HEAD> 
  32. <BODY> 
  33.     <MENU class=“controller”> 
  34.         <A href=“http://api.mywebsite.com/api/load-new-article” model=“MyArticleData">Click here to replace the articles with different articles.</A> 
  35.         <A href=“http://api.mywebsite.com/api/load-new-image” model=“MyImageData">Click here to replace the picture with a different picture.</A> 
  36.     </MENU> 
  37.     <MAIN class=“viewer”> 
  38.         <ARTICLE class=“center"> 
  39.             <H1 model=“MyArticleData.rsp.article(label=‘one’).headline” /> 
  40.             <SPAN model="MyArticleData.rsp.article(label=’one’).body” /> 
  41.         </ARTICLE> 
  42.         <ARTICLE class=“sidebar"> 
  43.             <H1 model=“MyArticleData.rsp.article(label=’two’).headline” /> 
  44.             <SPAN model=“MyArticleData.rsp.article(label=’two’).body” /> 
  45.         </ARTICLE> 
  46.         <IMG src=“model:MyImageData.rsp.image(label=‘Square’)#source” width=“model:MyImageData.rsp.image(label=‘Square’)#width” height=“model:MyImageData.rsp.image(label=’Square’)#height”> 
  47.     </MAIN> 
  48. </BODY> 
  49. </HTML> 

你覺得這個建議靠譜嗎?

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.