Home > Web Front-end > JS Tutorial > body text

Solution to the $ conflict between jquery and velocity variables in html files_jquery

WBOY
Release: 2016-05-16 17:18:06
Original
2030 people have browsed it
Problem description:

When using jquery in an environment using velocity template engine, such as: $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds /sfzc1@realintelligence.com/public/basic')

where $ conflicts with $ in the velocity variable.

Solution:

Define a velocity variable: #set($jquery="$.") Then: ${jquery}fullCalendar.gcalFeed('http: //www.google.com/calendar/feeds/sfzc1@realintelligence.com/public/basic'), using the replacement principle of the veloctiry template engine, the html code is compiled for the first time into $.fullCalendar.gcalFeed('http:// www.google.com/calendar/feeds/sfzc1@realintelligence.com/public/basic'), after being replaced, it was compiled twice and there was no problem with the code.

To sum up, the above answers a truth: "To untie a bell, one needs to tie it."
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template