Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
$.ajax永无止境的循环停止_Ajax_Infinite Loop - Fatal编程技术网

$.ajax永无止境的循环停止

$.ajax永无止境的循环停止,ajax,infinite-loop,Ajax,Infinite Loop,我有一个html文档,我想从一个外部html文件中加载一个表。在此文件中,应将另一个加载到同一文件中。当我开始这一步时,我得到了一个enless循环。 有谁能告诉我,我怎样才能在10次之后结束装载 好的,这是我的一些代码 html文档: <html> <head> <script type="text/javascript" src="jquery-1.6.2.min.js"></script> <script type="text/java

我有一个html文档,我想从一个外部html文件中加载一个表。在此文件中,应将另一个加载到同一文件中。当我开始这一步时,我得到了一个enless循环。 有谁能告诉我,我怎样才能在10次之后结束装载

好的,这是我的一些代码

html文档:

<html>
<head>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">

    function table(){
    $.ajax({    
    url: "table.html",
         success: function(data) {$('#test1').html(data);},
    error: function(){alert('no!');},
    });
</script>
</head>
<body>
<input type="Button" onclick="table();" value="KNOPF" id="knopf"/>
<p id="test1">TEST </p>
</body>
</html>

函数表(){
$.ajax({
url:“table.html”,
成功:函数(数据){$('#test1').html(数据);},
错误:函数(){alert('no!');},
});

测试

桌子


$.ajax({
url:“table.html”,
成功:功能(数据){
$('#test1').html(数据);},
错误:函数(){alert('no!');},
}); 

1.


可能是服务器端重定向/头重定向。请检查脚本中是否有一些重定向。

我们可以看看到目前为止您有哪些代码吗?向我们展示一些代码怎么样?
<html>
<head>
<script type="text/javascript" src="jquery-1.6.2.min.js"></script>
<script type="text/javascript">

$.ajax({    
    url: "table.html",
         success: function(data) {
    $('#test1').html(data);},
    error: function(){alert('no!');},
    }); 
</script>
</head>
<body>
<p id="test1"><p>
<table border="1">
<tr><td>1</td></tr>
</table>
</body>
</html>