d_iv.text未定义 [英] d_iv.text is undefined

查看:68
本文介绍了d_iv.text未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的Java脚本中出现错误,因为d_iv.text未定义.

这是代码:

Hi,

I am getting the error in my java script as d_iv.text is undefined.

Here is the code:

var d_lv=0;while(d_iv.text.charAt(0)=="|")

{d_lv++;d_iv.text=d_iv.text.substring(1);}

if(!d_ce||d_ce.d_le<d_lv)

{var newMenu={ULtype:0,i:[],style:itemList[d_iy][7],d_le:d_lv,parentItem:d_ce?

d_ce.i[d_ce.i.length-1]:null};

if(!mainMenu)

{mainMenu=newMenu;}if(newMenu.parentItem)

{newMenu.parentItem.childMenu=newMenu;}


d_iv.parentMenu=newMenu;d_ce=newMenu;}

while(d_ce&&d_ce.d_le>d_lv)

{d_ce=d_ce.parentItem.parentMenu;d_iv.parentMenu=d_ce;}

d_ce.i[d_ce.i.length]=d_iv;}

return mainMenu;}



在此先感谢



Thanks in advance

推荐答案

什么是d_iv?它是div元素吗?如果是,那么请注意,它没有带有文本"名称的属性.如果您打算使用JQuery,则可以使用名称为"text"的方法(不再是属性),该方法将为您提供div的文本.
如果您可以提供更多信息(例如您要实现的目标),也许我们将能够为您提供更好的帮助.
What is d_iv? Is it a div element? If yes then please note that it doesn''t have a property with "text" name. If you intend to use JQuery, then there is a method (not a property again) with name "text" which will give you the div''s text.
If you can provide some more information like what are you trying to achieve, may be we''ll be able to help you better.


这篇关于d_iv.text未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆