1.如果出错了,可以继续执行。
try {
window.a.b !== 2
}
catch(err){
alert(err) // 可执行
alert(123) // 可执行
}
if (window.a.b !== 2) {
alert("error") // 不执行
}
alert(123); // 不执行
https://www.cnblogs.com/yangheng/p/6018224.html
try {
yj_RepositoryID = parent.$("#yj_RepositoryID").combobox("getValue");//仓库号
}catch(err) {
yj_RepositoryID = $("#yj_RepositoryID").combobox("getValue");//仓库号
}
不确定这个combobox是父页面还是本页面,可以用这个try catch的方法,不影响程序向下运行。