I am working on a school project. It’s an internet page with XML / XSLT.
For the design we thought about an image fading effect in the background.
I made it as you can see and it works perfectly on IE7. But checking it in FF 3.6 throws some suspicious errors in firebug und does not work.
For example:
alert($('menu_bg').innerHTML);
works when used with document ready / observe. But none of these work:
$('#menu_dots').append("content"); // jQuery
$('menu_dots').insert("content"); // prototype
The point is, that I do not understand, why everything works without XSLT in both browsers. But when I do the same with XSLT it breaks in FF.
http://nak.erline.eu/index.xml
same domain /js/_script.js
I thought the problem is jQuery based, that’s why I started to translate it to prototype. On my half way I realized, that the problem still happens. That’s why the code is still with jQuery (commented) and Prototype.
Have you an idea?
If you have to work with XSLT, the HTML DOM, XML and cross-browser functionality, I can highly recommend Sarissa. It will make working with Microsoft’s hard and incompatible ActiveX DOM and all other W3C-based DOMs a lot easier.
The problem you are (likely, not necessarily) facing is that the resulting DOM objects do not belong to the same origin XML Documents, which is default DOM behavior. As a result, jQuery or Prototype cannot find the new elements. One workaround is to insert them as text and have them reparsed, but that’s costly. There are other workarounds, but the easiest is probably to have a look at Sarissa and learn to use it. It’s not hard and makes your code more readable. You’ll find that Sarissa takes care of these and other subtleties so you can worry about more important things..