超简单的jQuery加载

时间:2017-03-06 14:06:09

标签: jquery load

这个简单的代码只是不加载任何东西,问题出在哪里?

<head>
<script src="js/jquery.js"></script>
<script src="js/load.js"></script>
</head>
<body>

<div class="container-fluid bgres">
            <div class="container main" id="gora">

        </div>
</div>

</body>

load.js

$(document).ready(function() {
    $("#gora").load("gora.txt");
});

gora.txt只是从同一个地方剪下的HTML

我正在尝试假装php include函数

1 个答案:

答案 0 :(得分:0)

     $.ajax( "sample.txt" )
       .done(function(data) {
         $("#gora").html(data);
     });
  • 在HTTP中运行html文件(即)localhost协议不在FTP中运行 enter image description here