如何解决此错误,Microsoft JScript运行时错误:Internet Explore中应包含对象 [英] how to solve this error, Microsoft JScript runtime error: Object expected in Internet Explore
本文介绍了如何解决此错误,Microsoft JScript运行时错误:Internet Explore中应包含对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何解决以下错误.
Microsoft JScript runtime error: Object expected in Internet Explore only
how to solve below error.
Microsoft JScript runtime error: Object expected in Internet Explore only
function Val_Classification() {
var ddlClassif = document.getElementById("ddlClassification");
if (ddlClassif.Value == "0") {
alert("Kindly Select The ddlClassification");
return false;
}
return true;
}
我这样调用上面的函数:onblur="javascript:Val_Classification();"
ddlClassification是dropdownListBox控件
I call above function like this: onblur="javascript:Val_Classification();"
ddlClassification is dropdownList Box Control
推荐答案
考虑到ddlClassification是一个下拉列表,您无法通过这种方式访问它的值.
您将必须执行以下操作:
Considering ddlClassification is a dropdownlist, you can''t access it''s value this way.
You will have to do somthing like this:
var ddl = document.getElementById("<%=ddlClassification.ClientID>");
var ddltext = ddl.options[ddl.selectedIndex].text;
var ddlvalue = ddl.options[ddl.selectedIndex].value;
在您的代码中以类似的方式实现.
Implement similarly in your code.
这篇关于如何解决此错误,Microsoft JScript运行时错误:Internet Explore中应包含对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文