节点不能在层次结构的特定点插入 [英] Node cannot be inserted at the specified point in the hierarchy

查看:120
本文介绍了节点不能在层次结构的特定点插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我试图加载来自外部文件中的纯文本到我的网页,我不断收到错误的称号。我究竟做错了什么? (我也跟着教程完全相同!)谢谢你。

So I'm trying to load plain text from an outside file into my page and I keep getting the error in the title. What am I doing wrong? (I followed the tutorial exactly!) Thanks.

HTML

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script src="ajax.js"></script>
</head>

<body>
<input id="button" type="button" value="Load" />

<div id="content"></div>
</body>
</html>

JQuery的

JQuery

$("#button").click(function(){
    $.ajax({
      url:"AjaxRequest.html",
      success:function(data) {
      $("#content").html(data);
      }
    });
 });

编辑:这是显然没有成功。不知道为什么,该文件是有正确的旁边。

It is apparently no successful. Not sure why, the file is there right next to it.

推荐答案

尝试指定一个数据类型:

Try specifying a dataType:

$("#button").click(function(){
   $.ajax({
      url:"AjaxRequest.html",
      dataType:'html',
      success:function(data) {
        $("#content").html(data);
      }
   });
});

这篇关于节点不能在层次结构的特定点插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆