prototype and jQuery peaceful co-existence?

前端 未结 4 900
清酒与你
清酒与你 2021-02-08 07:22

I know very little about JavaScript but despite this I\'m trying to cobble something together on my wordpress blog. It\'s not working, and I don\'t know how to resolve it, and h

4条回答
  •  失恋的感觉
    2021-02-08 08:13

    Thanks for the suggestions all. In the end I think Kent's explanation was the closest, which basically amounted to "Prototype is broken". (Sorry if I'm summarizing you incorrectly :)

    As for the jQuery.noConflict option - I already mentioned this in the question. It makes a difference when you run this method, and I have very little control over that. As I said, I have tried running it in a couple of different places (specifically the page header and also from my script file), to no effect. So, much as we'd all like it to be, "just use noConflict" is not an answer to this question, at least not without additional information.

    Besides, jQuery.noConflict seems to be about the $ variable, and the code around the error point does not deal with that variable at all. Of course they could be related indirectly, I haven't tracked it down.

    So basically I ended up rewriting the script using jQuery instead of Prototype, which actually had its own problems. Anyway I've published the whole war story on my blog, should you be interested.

提交回复
热议问题