我的JS代码做得很好,直到我添加了以下功能:
$(".meassure-combo").change(function() {
switch ($(this).attr("name")) {
case "bust-combo":
case "shou-combo":
case "wais-combo":
case "hips-combo":
case "imse-combo":
$("[rel='"+$(this).attr("name")+"']").val( $(this).val() ).change();
break;
}
switch ($(this).attr("rel")) {
case "bust-combo":
case "shou-combo":
case "wais-combo":
case "hips-combo":
case "imse-combo":
var type = $(this).attr("rel");
var val = $(this).val();
$("[name='"+type+"']").val(val).change();
CL3D.interpolation(type,val);
break;
}
});
添加此代码后,我开始在控制台
中收到以下错误未捕获RangeError:超出最大调用堆栈大小 在RegExp.test()
问题是什么,我该如何解决?
提前谢谢
答案 0 :(得分:2)
.change()
事件处理程序中调用 change
。如果$("[rel='"+$(this).attr("name")+"']")
或$("[name='"+type+"']")
也有.className
"meassure-combo"
,则结果为Uncaught RangeError
。