我想隐藏和捕获 iframe js 错误,iframe 在同一域中,因此不存在跨站点脚本问题, 任何帮助,建议?
最佳答案
建议您实现一个 JavaScript try/catch block ,将错误发送到 IFrame 中的某些隐藏表单控件:
try{
//your javascript that can throw an error
}
catch(e)
{
document.getElementById("YourHiddenControlId").value = e.Message;
}
然后您可以访问 IFFrame 中的表单变量。
关于javascript - 如何捕获和隐藏 iframe js 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6327760/