Using JQuery and Prototype in the same page

前端 未结 12 1212
忘了有多久
忘了有多久 2020-11-30 03:39

Several of my pages use both JQuery and Protoype. Since I upgraded to version 1.3 of JQuery this appears to be causing problems, because both libraries define a function nam

12条回答
  •  春和景丽
    2020-11-30 04:22

    If I were you, I'd drop my no conflict code into a JavaScript include file like you opined about above, and then figure out some process where I'd be setting these things I need to include in all my pages in one central place. If you are working with straight HTML files and you don't have any kind of templating/scripting capability server-side for what gets included in a document, there's always the possibility of doing a Server-Side Include.

    Either way, the pain you'll experience updating each of your pages this time will come back again when you need to update your analytics code or the site footer.

提交回复
热议问题