Home > Article > Web Front-end > Found a solution to the conflict between jQuery and Prototype_javascript skills
I seem to have seen somewhere before that there is a conflict between jQuery and prototype, but I never paid attention to it. Today I put the message prompt box effects I wrote using the jquery framework into the company's original system and found that all the message prompt effects were broken!
After sweating for a long time, I still couldn’t find the reason. I suddenly thought of the conflict between jquery and prototype, and then I discovered that many pages of the company’s original system called the prototype framework. Once you know the reason, let’s find a way to solve it. I won’t have to break away from jquery and write it again. I searched the Internet and finally found some solutions. This is:
1. Put jquery.js into prototype. .js behind (this is necessary otherwise it will still fail anyway).
2. Rename the $ variable after jquery.js.
The method is as follows: