java script type error.

Hi i am using a fix for IE 8 7 6 to make it show my website in the correct layout
but i am getting the error:

uncaught type error: cannot read property 1 of null

the script works on the sub pages of the website but not the homepage.

 the script is from:
http://code.google.com/p/ie7-js/

the website i am making is live at: http://www.ecoadwaterlessurinals.co.uk/

below is the actual script that has the type error. i named it ieLayoutFix.js

it is available at http://www.ecoadwaterlessurinals.co.uk/assets/scripts/js/ieLayoutFix.js


i am not sure how i can get it working. i know its because its conflicting and it should be in a <!--[if lt IE 9]> but not sure how to fix the type error.

can any one take a look. thank you
LVL 1
helpchrisplzAsked:
Who is Participating?
 
BardobraveConnect With a Mentor Commented:
What you are describing seems like an element being bad closed or being closed where it shouldn't be.
0
 
BardobraveCommented:
Seems like if a variable that should contain certain value is being returned as null.

It could help if you unzip the .js file and tell us the line where the error is producing.
0
 
fiboCommented:
Seems you are mixing an array and an objet (which happens to be null).
Presumably the script tests the existence of an object which is accessible in IE only (or not acessible in IE only).
So the fact that the object is non-existent is probably not an error, and the test should handle it appropriately.
We need to know where in your code the error is notified, so we can guess where in your code the error happens.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
helpchrisplzAuthor Commented:
i put the script just before the close of body and it seems to have made a difference but only to some parts of the website. i have put a IF ie lower that 9 with a message to upgrade.
0
 
fiboCommented:
Yes, placing the js at the end of the body code might make a difference if the script is launched just after loading: it might reference parts of the body code that is not yet loaded, or some other js code which is not yet present.

It is also generally recommended that IF POSSIBLE the js code is loaded at the end of the code, so that it does not delay the load of the html code.

Again, if you could post the js lines where the error message does occur, we might be more helpful!
0
 
helpchrisplzAuthor Commented:
hi when i look with chromes inspect i see a error but its all on one line

what i see
0
 
helpchrisplzAuthor Commented:
i put it into lines with find and replace


its now is not erroring lol?

but my page is all messed up still..
0
 
fiboCommented:
Hmm.... you really don't want to give us the 10 lines of code around which the error occurs, right?
0
 
helpchrisplzAuthor Commented:
sorry fibo the problem was that it was all on one line as it is minimized. so the error shows for the entire code. so i whent and put a return (new line) after each " ; " then re-uploaded and there is no error now when i look with chromes inspect tool.

the home page is now half fixed as the header is showing correct but the middle part is all out side of the container. so am unsure what to do about it now.
0
 
helpchrisplzAuthor Commented:
also my navigation shows fine on the sub pages but on the index page it is just a unstyled list as if its not finding my css but other parts of the webpage is working. random... am trying to see if there is anything different between my code for each page to no avail
0
 
fiboConnect With a Mentor Commented:
looking at present version in IE: everything is OK on my computer (well, "today" overflows but this seems acceptable, abd could easily be worked around)

browsing thru code in IE: I would probably change the line
            $(document).ready(function() {
                  $("body").ezBgResize({
                        img     : "./sites/recycleU/images/bgBody.jpg", // Relative path example.  You could also use an absolute url (http://...).
                        
                        center  : true // Boolean (true or false). This is optional. Default is true.
                  });
            });
        
to
            $(document).ready(function() {
                  $("body").ezBgResize({
                        img     : "./sites/recycleU/images/bgBody.jpg",                         
                        center  : true
                  });
            });
just to make things clearer and to remove any chance that the js interpreter gets confused by multiple //
0
 
helpchrisplzAuthor Commented:
i will have to take a closer look into this but should close this now. thanks
0
All Courses

From novice to tech pro — start learning today.