【问题标题】:jQuery mobile - DOM Exception 18jQuery 移动 - DOM 异常 18
【发布时间】:2012-01-17 22:46:08
【问题描述】:

我正在尝试使用 jQuery mobile,但似乎无法开始。

我在本地服务器上托管了以下 HMTL 文件:

<!DOCTYPE html> 
<html> 
<head> 
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>
</head> 
<body>
</body>
</html>

这是什么原因

Javascript 错误:未定义的 SECUIRTY_ERR:DOM 异常 18

当通过我的 iPhone 从http://192.168.1.1:8000/mobile.html 访问时

【问题讨论】:

  • 您尝试过使用 Google 吗?似乎有一些相当不错的结果:google.com/search?q=SECUIRTY_ERR%3A+DOM+Exception+18
  • 是的,但它们主要是关于 webkit 通知或本地文件。我希望熟悉 jQuery mobile 的人对我无法加载脚本的原因有所了解。
  • 您遇到的错误很可能与您在本地机器上进行测试有关。

标签: javascript jquery iphone mobile jquery-mobile


【解决方案1】:

在 jquery 脚本包含标签之前,您是否也链接了 CSS 样式表文件?

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>

此外,为了显示页面,您必须将内容包含到容器中,如下所示:

<body>
  <div data-role='page'>
    <div data-role='header'>
    Header goes here
    </div>
    <div data-role='content'>
    Content goes here
    </div>
  </div>
</body>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-09
    • 2013-03-12
    • 2012-11-29
    • 1970-01-01
    • 2013-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多