I have Apache Velocity.
I have some jQuery code.
I think VM doesn’t like when I do things like $img.css("float","left").
How can I completely disable VM parsing within a block of HTML/Javascript ?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For short examples, like the above, if it isn’t a legitimate Velocity reference, just do $img and Velocity will ignore it.
It’s tempting to escape the reference, but this is extremely quirky. If $img is a real reference, then \$img will display $img. But if $img is not a Velocity reference, then \$img will display \$img.
The best bet, especially if you have a long block of text you do not want parsed, is to put it in a separate file and use #include, which does not parse the include text.
#include(“file.vm”)
This will include “file.vm” directly into the output without parsing it. (If you want to include text and parse that text, use #parse).