Javascript ajax调用给出了未捕获的RangeError:超出了最大调用堆栈大小
我在单击按钮时遇到以下错误Javascript ajax调用给出了未捕获的RangeError:超出了最大调用堆栈大小,javascript,ajax,jquery,Javascript,Ajax,Jquery,我在单击按钮时遇到以下错误 Uncaught RangeError: Maximum call stack size exceeded at jQuery.extend.jQuery.fn.extend jQuery.extend.jQuery.fn.extend jQuery.extend.jQuery.fn.extend jQuery.extend.jQuery.fn.extend jQuery.extend.jQuery.fn.extend jQuery.extend.jQuery.fn.
Uncaught RangeError: Maximum call stack size exceeded at
jQuery.extend.jQuery.fn.extend
jQuery.extend.jQuery.fn.extend
jQuery.extend.jQuery.fn.extend
jQuery.extend.jQuery.fn.extend
jQuery.extend.jQuery.fn.extend
jQuery.extend.jQuery.fn.extend
在这一行“argtoUpdate=JSON.stringify(response2.name);”
在以下代码中:
$.ajax({
url: 'http://tales.appedoncp.com/appcp/sanchita/api/sample.php',
dataType: 'jsonp',
data: {"json" : input_string},
success: function(response)
{
for(var i=0; i<response.names.length; i++)
{
$("#center_brp").append("<div id=\"word\"" + [i]+ " class=\"sample_words\">" + response.names[i] + "</div><br>");
}
var input = JSON.stringify(response.names);
$.ajax({
url: 'http://tales.appedoncp.com/appcp/sanchita/api/getSoundsFromWords.php',
dataType: 'jsonp',
data: {'words' : input},
success: function(response2)
{
for(var i=0; i<response2.name.length; i++)
{
$("#center_brp2").append("<div id=\"word\"" + [i]+ " class=\"sample_words\">" + response2.name[i] + "</div><br>");
}
***argtoUpdate = JSON.stringify(response2.name);***
}
});
},
error: function(e){
console.log(e);
}
});
return false;
});
$('#updateBtn').click(function(argtoUpdate){
$.ajax({
dataType: 'jsonp',
data: {'vocalize_name' : argtoUpdate},
url: 'http://tales.appedoncp.com/appcp/sanchita/api/getWordsFromVocalizeId.php',
success: function(result)
{
console.log(result);
/*for(var i=0; i<result.name.length; i++)
{
$("#center_brp3").append("<div id=\"word\"" + [i]+ " class=\"sample_words\">" + result.name[i] + "</div><br>");
}*/
},
error: function(e)
{
}
});
});
$.ajax({
网址:'http://tales.appedoncp.com/appcp/sanchita/api/sample.php',
数据类型:“jsonp”,
数据:{“json”:输入字符串},
成功:功能(响应)
{
对于(var i=0;我能看到一个示例响应吗?感谢@bfavaretto为您提供的时间。但是我发现了问题。当我将artoUpdate声明为全局变量并将其从updatebtn click函数中删除时,它起了作用。我从6小时起就开始处理它,但在我问到这里几秒钟后才发现错误。@sanvj,这就是许多问题的工作方式。aIt’只要你一问,你就会自己找到解决办法