Cannot read property 'style' of null - in Chrome's Javascript Console -
i checking js console out , helped me fix few minor issues, know if warning worry about?
this code gives error:
<script type="text/javascript" src="https://www.safaviehhome.com/product_images/locations/js/jqgalscroll.js"></script> <script src="https://www.safaviehhome.com/product_images/mainnav/stuhover.js" type="text/javascript"></script> <script> function layersetup(id,visibility){ if(document.getelementbyid){ this.obj = document.getelementbyid(id).style; uncaught typeerror: cannot read property 'style' of null uncaught typeerror: cannot read property 'style' of null <!--includes many more of same "cannot read property 'style' of null messages --> this.obj.visibility = visibility; return this.obj;} else if(document.all){ this.obj = document.all[id].style; this.obj.visibility = visibility; return this.obj;} else if(document.layers){ this.obj = document.layers[id]; this.obj.visibility = visibility; return this.obj;} } function visvisible(param){ new layersetup(param,'visible'); } function vishidden(param){ new layersetup(param,'hidden'); }</script> i cannot figure out why happening , whether it's should worry since our rug categories function fine. can offer insight? apologize not offering of own explanations didn't write js former co-worked did , it's me debug every mistake made. it's learning process i'm still new ..
this happening 2 reasons.
- somewhere on page
layersetupfunction being callednull1 of parameters. - an element id being passed the
layersetupfunction not exist on page.
in chrome dev console can click pause on exceptions, button in bottom left bar pause symbol. determine parameters are being passed function.
Comments
Post a Comment