www.webdeveloper.com
Results 1 to 2 of 2

Thread: Internet Explorer Error

  1. #1
    Join Date
    Feb 2012
    Posts
    8

    Internet Explorer Error

    Site: www.lindsayadvantage.com

    I built the site above and everything works in Firefox and Safari but I'm having some issues in Internet Explorer.

    For example when you click on Fieldnet and then click on the red circle icons with the "i" in them, you should see an info box show up for each of the icons. This is a javascript toggle function.

    IE Error: Object doesn't support this property or method

    Firebug shows: toggle.js (line 10)
    elms[i].style is undefined

    elms[i].style.display = 'none';

    Any help in how to fix this error would be greatly appreciated.

    Thanks!
    Last edited by bluecollar01; 07-26-2012 at 02:37 PM.

  2. #2
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,667
    you have a couple of problems

    1 document.getElementsByClassName does not have universal support

    2 you call the function before the pages have loaded

    Code:
    function toggleSpecific(elementid) {
    	var elms = bycls('divs',document);
    	var node = document.getElementById(elementid);
    	for(i in elms){
    		if(node&&elms[i]==node)
    			elms[i].style.display = 'block';
    		else
    			elms[i].style.display = 'none';
    	}
    }
    //toggleSpecific('hide1');
    
    function bycls(nme,el){
     for (var reg=new RegExp('\\W'+nme+'\\W'),els=el.getElementsByTagName('*'),ary=[],z0=0; z0<els.length;z0++){
      if(reg.test(' '+els[z0].className+' ')){
       ary.push(els[z0]);
      }
     }
     return ary;
    }
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles