Microsoft JScript运行时错误:必需对象 [英] Microsoft JScript runtime error: Object required
本文介绍了Microsoft JScript运行时错误:必需对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
function pnlvisible()
{
//document.getElementById('ctl00_ContentPlaceHolder1_drptree_pnl').
//if (document.getElementById("ctl00_ContentPlaceHolder1_drptree_pnl").style.visibility == "visible")
//{
document.getElementById("ctl00_ContentPlaceHolder1_drptree_pnl").style.visibility = 'hidden';
//}
}
我收到Microsoft JScript运行时错误:运行时需要对象.
i am getting Microsoft JScript runtime error: Object required during the runtime.
what is error .Is there anyway to solve this.
推荐答案
上一行错误表示未定义以下内容:document.getElementById("ctl00_ContentPlaceHolder1_drptree_pnl")
.因此,当您尝试访问某些属性时,它无法找到该对象,从而引发错误.
2个选项:
1.确保名称与页面呈现时的名称完全相同(您可以通过页面查看源代码获取它)
2.使用:<%= myPanel.ClientID %>
Error for the above line means that the following was undefined:document.getElementById("ctl00_ContentPlaceHolder1_drptree_pnl")
. Thus, when you try to access certain property, it is unable to find the object and thus raises an error.
2 Options:
1. Either make sure that the name is exactly the same as when page rendered (you can get it doing page view source)
2. Use:<%= myPanel.ClientID %>
这篇关于Microsoft JScript运行时错误:必需对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文