Solved

Javascript cross browser issues

Posted on 2011-02-27
2
478 Views
Last Modified: 2012-05-11
Hello,

I'm having issues with a Javascript for flipping pictures on my front page of the website.

The site looks fine in Mozilla Firefox but no in IE, Chrome or Opera etc... site is here www.nordisk-solvarme.se

The error code I get in IE:

Message: 'undefined' is null or not an object
Line: 12
Char: 388
Code: 0
URI: http://www.nordisk-solvarme.se/js/jquery.nivo.slider.pack.js
0
Comment
Question by:SvassUK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Expert Comment

by:Aazmodeus
ID: 34992269
Oh my, the code is compressed.
The error is in the plugin code. It is caused because in some part of the code (which is hard to tell, because the code is completely unreadable when compressed) it tries to get string value from attribute 'title' of some image (var name g.currentImage). The atribute is undefined, but it passes the safety check because it checks only for empty string for some reason.
I suggest you use some other plugin, or write the author of the plugin about the bug. Maybe he/she'll fix it.
...
if(g.currentImage.attr("title")!=""){
   k=g.currentImage.attr("title");
   if(k.substr(0,1)=="#")
      k=a(k).html();
...

Open in new window

0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 34992295
First, you have <div id="box"> and <div id="box_inner"> defined three times.  'id's are only supposed to be used once on a page, especially when your javascript has to use the 'id' to locate an object or element.  The error message refers to a element attribute and even Firefox complains about some of your CSS.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question