Discuz Tutorial: discuz template js and jquery conflict solution

Source: Internet
Author: User

Today when doing discuz template, use jquery and the original theme JS conflict. This is mostly Discuz x uses $ (ID) as the Fetch method for the DOM node, and the $ symbol just happens to conflict with jquery's default symbol.
The following are workarounds based on previous discuz x and jquery conflicts. For everyone to make a reference!

The jquery js file jquery-1.8.0.min.js into the/static/js directory, the following two methods share this file, if not placed in the directory, the subsequent code, please modify the corresponding.

Workaround 1:
Modify the/template/default/common/header_common.htm, in the 16th line of code
Then add the following code:

Copy Code
The code is as follows:

<script src= "{$_g[setting][jspath]}jquery-1.8.0.min.js? {Verhash} "></script>

After that, use jquery's $ (instead of the place.

Workaround 2:
Modify/template/default/common/header.htm to add the following code before the 20th line of code:

Copy Code
The code is as follows:

<script src= "{$_g[setting][jspath]}jquery-1.8.0.min.js? {Verhash} "></script>

Discuz Tutorial: discuz template js and jquery conflict solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.