在Web浏览器中编译HTML5代码的问题

时间:2013-05-21 11:04:05

标签: html5 jquery-mobile

我使用TextEdit创建了移动jquery的演示页面,即

<!doctype html>
<html>
<head>
    <title>My Page</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css">
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
    <div data-role="page">

        <div data-role="header">
            <h1>My Title</h1>
        </div><!-- /header -->

        <div data-role="content">
            <p>Hello world</p>
        </div><!-- /content -->

        <div data-role="footer">
            <h4>My Footer</h4>
        </div><!-- /footer -->

    </div><!-- /page -->
</body>
</html>

但是,在我的浏览器中代码没有被编译,它显示这些文本,因为它是纯文本..我确认我的浏览器支持HTML5:http://html5test.com/

缺少什么!?

3 个答案:

答案 0 :(得分:1)

问题是您使用的浏览器是什么?我在Chrome上尝试了您的代码,但效果非常好。

enter image description here

我的猜测是,你是企业或大学防火墙背后的封锁你的CDN网址。那么为什么不下载jQuery移动文件并在本地放置js,css文件并尝试再次运行该页面?

答案 1 :(得分:0)

src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

答案 2 :(得分:0)

抱歉,但问题很奇怪,实际上我使用textEdit创建了该页面,该文本将所有文本存储为富文本格式,可能无法识别为编译为html ...所以我将该文本转换为纯文本并再次保存那工作!!

谢谢大家。