错误:HIERARCHY_REQUEST_ERR:DOM 异常 3

发布于 2024-12-25 18:49:51 字数 840 浏览 3 评论 0原文

我正在尝试为 Google Chrome 开发一个应用程序:打包应用程序

在我的例如,使用命令 $.get 检索 HTML 页面并将其插入当前页面:

Page HTML

<body>
    <div id="wrap"></div>
</body>

Script

$.get(url, function(html) {
    $("#wrap").html(html);
});

错误发生在线: $("#wrap").html(html);

尝试

搜索互联网,我发现这个问题在 stackoverflow 上,但这对我没有多大帮助。

另一个细节是该示例不是 Chrome Web 应用程序。 同样的示例完美地发布在互联网上:http://ridermansb.kodingen.com/

I'm trying to develop an app for Google Chrome: Packaged Apps

In my apolicação, use the command $.get to retrieve an HTML page and insert it into the current page:

Page HTML

<body>
    <div id="wrap"></div>
</body>

Script

$.get(url, function(html) {
    $("#wrap").html(html);
});

The error occurs on the line: $("#wrap").html(html);

Attempts

Searching the internet, I found this question here on stackoverflow, but this did not help me much.

Another detail is that this example is not a Chrome Web App.
This same example, works perfectly posted on the Internet at: http://ridermansb.kodingen.com/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们只是彼此的过ke 2025-01-01 18:49:51

如果您的响应是 HTML,请尝试在 $.get() 中指定 dataType,如下所示:

$.get(url, function(html) {
    $("#wrap").html(html);
}, 'html');

我在附加来自 jQuery 的响应时遇到了完全相同的问题$.post()。响应是 HTML,但 jQuery 无法(无论出于何种原因)正确确定数据类型。

If your response is HTML, try specifying the dataType in the $.get() like so:

$.get(url, function(html) {
    $("#wrap").html(html);
}, 'html');

I just had exactly the same problem attaching the response from a jQuery $.post(). The response is HTML but jQuery could not (for whatever reason) correctly determine the data type.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文