Hi Guys & Gals,

I have a JS file for an AJAX app that works great in Firefox, Chrome, and Opera, but not in IE6 or IE7. The JS file is located here: and the XML file it grabs info from is right here:

I think the problem is in the JS file, but I can't seem to find the error, can someone please help me out.

thanks,

Dani AI

Generated

Brief recap and practical takeaways from this thread: correctly found that a method call in the modified Imago script caused IE to throw a runtime error and halt execution (IE6–8 stop scripting on the first uncaught error, while other browsers often continue). confirmed the page is working again, so use the checklist below when changing the plugin or adding fields like description/size/price.

Common diagnostics and quick guards

  • Open IE's Script Debugger (F12) and note the exact exception and line number.
  • Make sure logging won't itself break older IE (console is undefined when DevTools are closed). Add a tiny fallback before any console calls:
if (!window.console) { window.console = { log: function(){}, warn: function(){}, error: function(){} }; }
  • Before calling a method that might not exist on an object, check it defensively:
var desc = '';
if (obj && typeof obj.getDescription === 'function') {
  desc = obj.getDescription();
} else if (obj && obj.getAttribute) {
  desc = obj.getAttribute('description') || '';
}

Practical fixes you can apply

  • Avoid attaching custom methods directly to host DOM objects; some IE versions do not accept expandos or behave differently. Instead store data in a JS map keyed by element id or use a library data store (for example, jQuery.data).
  • When walking XML/DOM node lists, skip non-element nodes (text/comment) with nodeType === 1. Use classical index loops (for (i=0;i<len;i++)) rather than for..in.
  • Check for syntax issues that break IE: trailing commas in object/array literals, reserved words used as property names, missing parseInt radix (use parseInt(x,10)), and reliance on newer JS features not in IE8.

Final note
Because IE swallows later script execution on the first uncaught error, add small defensive checks around any new calls you add. That approach keeps the rest of the gallery running even if a single optional field or method is missing.

Recommended Answers

All 6 Replies

Well at first glance it looks like your JS file contains some JQuery, so I would start by making sure you have the JQuery library included in your page. It would also help if you could give us the address of the gallery page as it might aid in finding the problem.

right...sorry about that. The Website address is:

The problem is with the descriptions. It's just that IE will stop working on errors while most other browsers will try to continue. Specifically, the problem with your code is with line 248. Specifically the line that contains:

description = this.getDescription();

I would delete that line if the image descriptions are not important (which they probably are). I'll investigate more and see what the specific problem is with this line. IE claims it as: "Object doesn't support this property or method." Did you write this code yourself or do you know if there is any documentation that we can examine? It would help to have some kind of explanation for the code.

the original code is found here:
http://imago.codeboje.de/
I added the other goodies such as description, size, and price.

thank you very much for your help so far

Thanks to all ...IT WORKS GREAT !!

That's great that you got it to work! If you don't have any more questions...would you please mark this thread as solved?

commented: thanks for the help !! +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.