Error: HIERARCHY_REQUEST_ERR: DOM Exception 3

血红的双手。 提交于 2019-12-08 15:45:15

问题


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/


回答1:


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.



来源:https://stackoverflow.com/questions/8810794/error-hierarchy-request-err-dom-exception-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!