views:

196

answers:

1

I have a page that uses a bit of jQuery and an effect called 'kwick' - in my sample page hosted at http://www.batsumaru.com/main.html it worked fine in all browsers, no problem. But when the actual code was produced at http://www.batsumaru.com Internet Explorer shows a script error (object does not support).

I tried my best to debug but couldn't figure out what was happening, the code seems identical from one page to another, can anyone show me the genius insight that can turn this around for me and help me cope with the wonderful world of IE?

+4  A: 

This is a combination of an IE "bug" (in that it pretends that elements with an ID are identifiers at the Javascript global level) and Kwick plug-in which fails to var a variable.

Kwick is using a variable internally called container, but doesn't use var on it hence it would be created globally. Your page contains a div with the ID container and hence IE assumes the Kwick code is is trying to assign a value to a COM based element's default property, DOM elements do not have a default property hence the "does not support" error.

Change the div ID to something else and all should be well.

AnthonyWJones
I will! So multiple ID's seem not to bother Firefox/Safari, but I can see it's a no-no, I am very grateful!
On IE does that really anonying thing of making IDs of elements appear as identifiers globally in Javascript. Other browsers don't do it so it would be ok to have a global javascript variable and a DOM element ID use the same name since they are entirely different things.
AnthonyWJones
One only wishes the javascript error said 'tried to redefine 'container'' or something helpful! Still, your help is most appreciated, I spent many hours (mainly setting up parallels) to try and track this down. Cheers!