Hi,
I'm afraid your requiremnets cannot be satisified with unedited
library files. If you load jQuery and Prototype on the same page, you
_must_ use noConflict immedately after loading jQuery, not after a
delay. This is because Prototype, at present, relies on the global `$`
symbol in various places (it _really really shouldn't_, this is what
scoping functions like the one used by jQuery are for!), including
where it's firing its "dom loaded" event. So you get an error if
Prototype tries to fire "dom loaded" before noConflict is called.
So you must put the noConflict call outside the setTimeout call. That
doesn't mean any of your other code has to be there, just that call.
So change:
setTimeout(function() {
try {
jQuery.noConflict();
$("first").addClassName("blue");
}
catch (e) {
alert(e);
}}, 500);
to
jQuery.noConflict();
setTimeout(function() {
try {
$("first").addClassName("blue");
}
catch (e) {
alert(e);
}}, 500);
Your only other alternative is to use an edited prototype.js file,
which will be non-trivial.
HTH,
--
T.J. Crowder
Independent Software Engineer
tj / crowder software / com
www / crowder software / com
On Sep 16, 6:51 am, Ron Gross <
ron.gr...@gmail.com> wrote:
> Cross posted to jQuery mailing list<
http://forum.jquery.com/topic/jquery-and-prototype-conflicts-in-ie8-w...>
> .
>
> This problem seems to be quite old<
http://stackoverflow.com/questions/2830510/jquery-noconflict-not-work...>.