473,414 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

How to fix "object doesn't support this property or method" Javascript error on IE 8?

Hi all experts,

I've "object doesn't support this property or method" error when running a Javascript on Internet Explorer 8 This is the statement that is having the error:-

this.nodes=(node.obj.draw(0,0,this.getp(node,"widt h","100%"),0,this.getp(node,"bgcolor",0),0,(100 0-this.num),this.getp(node,"div_class",0),s));
}
Please kindly advise on this error can be fixed please

Thank you very much

Below is my full javascript program:-

Expand|Select|Wrap|Line Numbers
  1. bw=new Browser();
  2. function SoftDrawerTree(name,def){
  3.     this.def=def;this.format=def.format;this.name=name;this.num=0;this.anim_ref=0;this.id='SDTree'+name;
  4.     this.nodes=[];this.root={id:name+"_i"};this.root.level_format=this.format;
  5.     this.root.format=this.format;
  6.     this.root.sub=def.sub;eval("window."+this.id+"=this");
  7.     if (!bw) bw=new Browser();
  8.     this.init=function(){
  9.         this.code='';
  10.         this.back=new DHTMLObject(this.name+'_back');
  11.         this._init(null,this.root,-1,0);
  12.         if (!this.format.no_images) {var f=this.format;pldImg([f.e_image,f.c_image])};
  13.         document.write(this.back.draw(this.format.left,this.format.top,this.format.width,this.format.height,this.getp(this.root,"back_bgcolor",0),0,1,this.getp(this.root,"back_class",0),this.code,0)+this.wm_code());
  14.         this.back.init();if (this.format.dont_resize_back)this.back.show();
  15.     };
  16.     this._init=function(parent,node,lvl,num){
  17.         if(!node) return; node.parent=parent; node.id=node.id||node.parent.id+"_"+num;node.lvl=lvl;node.ind=(this.num++)-1;
  18.         if(node!=this.root){
  19.             this.nodes[node.id]=node;var s=this.init_item(node);
  20.             node.obj=new DHTMLObject(node.id);
  21.             this.nodes=(node.obj.draw(0,0,this.getp(node,"width","100%"),0,this.getp(node,"bgcolor",0),0,(1000-this.num),this.getp(node,"div_class",0),s));
  22.         }
  23.         if(node.sub) for(var i=0;i<node.sub.length;i++) this._init(node,node.sub[i], lvl+1,i);
  24.     };
  25.     this.wm_code=function(){
  26.     this.wm=new DHTMLObject(this.name+'_wm');
  27.         return this.wm.draw(this.format.left,this.format.top+this.format.height+2,this.format.width,12,0,1,2,0,(bw.ns4?'<font face="Verdana, sans-serif" color=silver point-size=6>':'<div style="font-size:1px;color:white;">')+unescape('%53%6F%66%74%44%72%61%77%65%72%20%6A%73%54%72%65%65')+(bw.ns4?'</font>':'</div>'));
  28.     };
  29.     this.getp=function(n,name,def,nf){return this.format[name]||def};
  30.     this.indent_code=function(n){
  31.         var indent=this.getp(n,"indent",parseInt(this.format.level_indent||16)*n.lvl-this.getp(n,"padding",0))||0;
  32.         return n.lvl&&indent?'<td><img src="'+this.format.b_image+'" width="'+indent+'" height="1"></td>':'';
  33.     };
  34.     this.init_item=function(n){
  35.         var tc=this.getp(n,"table_class",0);
  36.         var s='<table width="'+this.getp(n,"width","100%")+'" cellpadding="'+this.getp(n,"padding",0)+'" cellspacing="'+this.getp(n,"spacing",0)+'" border="0"'+(tc?' class="'+tc+'"':'')+'><tr>';
  37.         s+=this.indent_code(n);
  38.         var img=this.getp(n,(n.sub?n.exp?"e":"c":"i")+"_image",this.format.b_image);
  39.         var sz=this.getp(n,"img_size",[30,15]);
  40.         s+=!this.getp(n,"no_images",0)?'<td>'+(n.sub?'<a onclick="if(this.blur)this.blur()" href="javascript:Toggle(\''+this.name+'\',\''+n.id.substr(this.name.length+3)+'\',0)">':'')+'<img '+(bw.ns4?'name="'+n.id+'_img" ':'')+'id="'+n.id+'_img" src="'+img+'" width="'+sz[0]+'" height="'+sz[1]+'" border="0"/>'+(n.sub?'</a>':'')+'</td>':'';
  41.         var bgc=this.getp(n,"item_bgcolor",0);bgc=bgc?' bgcolor="'+bgc+'"':' ';
  42.         var targ=n.target||this.format.target||0;
  43.         tc=this.getp(n,"item_class",0);var lc=this.getp(n,"link_class",0);
  44.         var hr='Toggle(\''+this.name+'\',\''+n.id.substr(this.name.length+3)+'\',1)';
  45.         s+='<td width="100%"'+bgc+(tc?'class="'+tc+'"':'')+'><a '+(lc?'class="'+lc+'"':'')+'href="'+(n.url||'javascript:'+(n.sub?hr:'void(0)'))+'" onclick="if(this.blur)this.blur();'+(n.sub&&n.url?'Toggle(\''+this.name+'\',\''+n.id.substr(this.name.length+3)+'\',1)':'')+'"'+(targ?' target=':'')+'target=Main>'+n.html+'</a>'+'</td>';
  46.         s+="</tr></table>";
  47.         return s;
  48.     };
Attached Files
File Type: txt Javascript.txt (3.4 KB, 569 views)
Jan 21 '11 #1
2 7219
Dormilich
8,658 Expert Mod 8TB
assuming the error is about node.obj.draw() you need to ensure that node & node.obj are the objects you expect. (I guess FireBug Lite will be necessary for this)
Jan 22 '11 #2
Thanks for kind advice, will try.

Do you've any recommendation how the statement below can be modified for it to work with IE8?


this.nodes=(node.obj.draw(0,0,this.getp(node,"widt h","100%"),0,this.getp(node,"bgcolor",0),0,(100 0-this.num),this.getp(node,"div_class",0),s));
}

Please kindly advise

Thank you very much in advance
Jan 24 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: KathyB | last post by:
I have the following script in an html page: function goToPosition() { varGoTo = document.write(document.cookie("Position")); document.scrollTo(0, varGoTo); } </head> <body...
2
by: Olaf | last post by:
I have a frameset page witch contains the myFuc() function. The function is accessed from a page in one of the frames in the frameset. An example is shown below. <input...
3
by: news.onetel.net.uk | last post by:
I and my friend Karl have spent literally all day trying to find out what is causing my error but we are zapped of any further functionality :) I have a form that adds news records. You select...
2
by: SmittyBroham | last post by:
Hello, I have a function that loops through 2 select lists and records the values of any hi-lighted options a user would have selected. It then sets 2 corresponding "hidden" form elements to the...
4
by: Otis Hunter | last post by:
I have been fighting with this for days and your expert help is needed! Below is the code I am executing which results with "Object doesn't support this property or method". The error is occuring...
2
by: todd | last post by:
Hi all. I inherited this code from a contractor. It is a .NET user control that runs on the client side (ie) on machines with the framework installed. I have been mucking around to get it work...
5
by: den2005 | last post by:
Hi everybody, Problem with dragging effect of resizing is working but having problem with setting a flag to determine if mouse button is click or not. Is there anyone knows how to fixed this? I...
1
by: hhackwell | last post by:
Hi guys, I'm running a simple piece of Javascript on my website to allow users to make an object appear when they want to use it. It works fine but I keep getting this error on IE and although...
1
by: chetan7991 | last post by:
I'm using a jquery plugin Galleriffic in my page and it shows perfectly in all browsers except IE. The error says: "Object doesn't support this property or method" The code I use for script...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.