Resolution of the $conflict between jquery in HTML files and the velocity variable

  • 2020-03-26 21:45:40
  • OfStack

Problem description:

In the use of the velocity template engine environment, when using jquery, such as: $. FullCalendar. GcalFeed (' ')

Where $conflicts with $in the velocity variable.


Define a velocity variable: #set($jquery="$.") and then: ${jquery} fullCalendar. GcalFeed (' '), using the template engine veloctiry substitution principle, HTML code first compiled into $. FullCalendar. GcalFeed (' '), be replaced after the second compilation, code without any problems.

To sum up, there is a truth: "the person who ties the bell must tie the bell."

Related articles: