このコードの何が問題になっていますか:
function obj2string(obj) {
var result = '';
for(var i in obj) {
if(typeof(obj[i]) === 'object') {
result += obj2string(obj[i]);
} else {
result += i + " => " + obj[i] + "\n";
}
}
return result;
}
結果の文字列を新しいプロパティで再帰的に集中させることになっていますが、ある時点で再帰が多すぎます。
私は次のようなオブジェクトを渡していました:$(this);
->jQueryから。
$(this)
このjQueryセレクターのインスタンスである:$('.debug');
witchには、現在のドキュメントで一致する1つのクラスがあります。