设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 开源资讯 查看内容

HTML6无JavaScript的单页应用引起一片哗然

2015-3-29 20:59| 发布者: joejoe0332| 查看: 1305| 评论: 0|原作者: jaxenter|来自: oschina

摘要: 关于 HTML6 意在实现无 JavaScript 的单页应用,这引起了前端开发社区一片哗然。请深呼吸,然后继续下面内容。W3.org 分享了一个 casual proposal for HTML6 ,这引起了前端社区的激烈争论。来自前 NSA 雇员和创业企 ...

  关于 HTML6 意在实现无 JavaScript 的单页应用,这引起了前端开发社区一片哗然。请深呼吸,然后继续下面内容。


  W3.org 分享了一个 casual proposal for HTML6 ,这引起了前端社区的激烈争论。来自前 NSA 雇员和创业企业级 Bobby Mozumder 提交了这份建议,声称一个高性能的响应式 Web 体验无需 JavaScript 支持。


  Mozumder 写道:新兴的 Web 应用通过 JSON API 加载动态内容,这是单页应用的一个标准设计模式。大多数人采用这种方法是因为它比加载一个完整 HTML 页面要节省很多时间。


  这种模式使用那么的广泛,因此 Mozumder 的建议是未来浏览器应该直接提供动态加载内容的功能,而不需要开发者编写任何 JavaScript 代码。


  下面是 Mozumder 建议的 HTML 代码:

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


  你觉得这个建议靠谱吗? 

via jaxenter


酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部