I seem to have seen somewhere before that jQuery and prototype conflict, but I haven't cared about it. Today, I put the special effects of the message prompt box written by myself in the jquery framework on the company's original system and found that all the message prompt effects went on strike!
After sweating for a long time, I still couldn't find the reason. Suddenly I thought of the conflict between jquery and prototype, and then I found that many pages of the company's original system called the prototype framework. If you know the reason, you can find a way to solve it. You won’t let me get out of jquery and write it again. I searched online and finally found some solutions. This is:
1. Put it in the back (this is necessary, otherwise you will still have to strike anyway).
2. Rename the $ variable later.
The method is as follows:
<script type="text/javascript" type="text/javascript" src=""></script>
<!--The above method calls the jquery framework-->
<script type="text/javascript" type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
var jQuery=$;
</script>
3. Replace the original $ method name with jQuery name, such as $("obj") with jQuery("obj").
The problem will be solved quickly according to the above three steps.
After sweating for a long time, I still couldn't find the reason. Suddenly I thought of the conflict between jquery and prototype, and then I found that many pages of the company's original system called the prototype framework. If you know the reason, you can find a way to solve it. You won’t let me get out of jquery and write it again. I searched online and finally found some solutions. This is:
1. Put it in the back (this is necessary, otherwise you will still have to strike anyway).
2. Rename the $ variable later.
The method is as follows:
Copy the codeThe code is as follows:
<script type="text/javascript" type="text/javascript" src=""></script>
<!--The above method calls the jquery framework-->
<script type="text/javascript" type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
var jQuery=$;
</script>
3. Replace the original $ method name with jQuery name, such as $("obj") with jQuery("obj").
The problem will be solved quickly according to the above three steps.