JavaScript调试断点 [英] JavaScript debugging break points
本文介绍了JavaScript调试断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请参阅下面的代码,我将调试器放在几个地方。 调试器断点适用于其中一些但不是成功的:功能(结果){...}
var ajaxData;
调试器;
$ .ajax({
type:' 获取',
url:myURL,
contentType:' application / json; charset = utf-8' ,
dataType:' json',
success:function(results){
调试器; // 此处不起作用
ajaxData = results;
},
错误:函数(xhr,状态,错误){debugger;}
});
这段代码出了什么问题?谢谢。
解决方案
.ajax({
type:' 获取',
url:myURL,
contentType:' application / json; charset = utf-8',
dataType:' json',
成功:函数(结果){
调试器; // 不在此处
ajaxData = results;
},
error:function(xhr,status,error){debugger;}
});
这段代码有什么问题?谢谢。
解决了数据从ASPX.cs到JavaScript [ ^ ]和从WebMethod使用数据获取JQuery [ ^ ]。
See the code below where I put debugger at several places. The 'debugger' break points work for some of them but not the one in the success:function(results) { ... }
var ajaxData;
debugger;
$.ajax( {
type:'Get',
url: myURL,
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success:function(results) {
debugger; // Not working here
ajaxData = results;
},
error: function(xhr, status, error) { debugger; }
});
What's wrong in this piece of code? Thanks.
解决方案
.ajax( { type:'Get', url: myURL, contentType: 'application/json; charset=utf-8', dataType: 'json', success:function(results) { debugger; // Not working here ajaxData = results; }, error: function(xhr, status, error) { debugger; } });
What's wrong in this piece of code? Thanks.
Solved at Data from ASPX.cs to JavaScript[^] and Get Data from WebMethod Using JQuery[^].
这篇关于JavaScript调试断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文