?
Solved

Javascript cross browser issues

Posted on 2011-02-27
2
Medium Priority
?
483 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
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 84

Accepted Solution

by:
Dave Baldwin earned 2000 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

807 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