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.

  1. somewhere on page layersetup function being called null 1 of parameters.
  2. an element id being passed the layersetup function 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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -