Solved

Javascript cross browser issues

Posted on 2011-02-27
2
473 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
Comment Utility
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 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
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 …
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…

728 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now