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

html文件中jquery与velocity变量中的$冲突的解决方法_jquery

WBOY
Release: 2016-05-16 17:18:06
Original
1972 people have browsed it
问题描述:

在使用velocity模版引擎的环境下,使用jquery时,如:$.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/sfzc1%40realintelligence.com/public/basic')

其中$与velocity变量中的$冲突。

解决方案:

定义一个velocity变量:#set($jquery="$.") 然后:${jquery}fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/sfzc1%40realintelligence.com/public/basic'),利用veloctiry模板引擎的替换原则,html代码第一次编译成$.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/sfzc1%40realintelligence.com/public/basic'),被替换之后二次编译,代码没有任何问题。

综上所述应了一个真理:“解铃还需系铃人”
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!