Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3229372
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:48:11+00:00 2026-05-17T16:48:11+00:00

I try add javascript to my velocity template. <html> <head> <title>:: $currency.CurrencyName Detail Info

  • 0

I try add javascript to my velocity template.

<html>

<head>
<title>:: $currency.CurrencyName Detail Info ::</title>
</head>

<body>
<table>
 <tr>
  <td>Name</td>
  <td>$currency.CurrencyName</td>
 </tr>
 <tr>
  <td>Jual</td>
  <td><div id="$currency.CurrencyName_buy">$currency.Buy</div></td>
 </tr>
 <tr>
  <td>Beli</td>
  <td><div id="$currency.CurrencyName_sell">$currency.Sell</div></td>
 </tr>
</table>


<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
    $(document).ready(function() {
        setInterval(function() {
            $.get('updateCurrency.htm', function(data) {
                $('#time').text(data);         
            });
        }, 5 * 60 * 1000); // 1000 milliseconds = 1 second.
    });
</script>

<p>Current date/time is: <span id="time"></span>
</body>

</html>

but I got the following error:

org.apache.velocity.exception.ParseErrorException: Encountered "," at line 28, column 29 of currencyDetail.html
Was expecting one of:
    <EOF> 
    "(" ...
    <RPAREN> ...
    <ESCAPE_DIRECTIVE> ...
    <SET_DIRECTIVE> ...
    "##" ...
    "\\\\" ...
    "\\" ...
    <TEXT> ...
    "*#" ...
    "*#" ...
    <STRING_LITERAL> ...
    <IF_DIRECTIVE> ...
    <STOP_DIRECTIVE> ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <WORD> ...
    <BRACKETED_WORD> ...
    <IDENTIFIER> ...
    <DOT> ...
    "{" ...
    "}" ...

 at org.apache.velocity.Template.process(Template.java:137)
 at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
 at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
 at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
 at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1077)
 at org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:528)
 at org.springframework.web.servlet.view.velocity.VelocityView.getTemplate(VelocityView.java:535)
 at org.springframework.web.servlet.view.velocity.VelocityView.getTemplate(VelocityView.java:520)
 at org.springframework.web.servlet.view.velocity.VelocityView.checkTemplate(VelocityView.java:293)
 at org.springframework.web.servlet.view.velocity.VelocityView.initApplicationContext(VelocityView.java:258)
 at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
 at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:323)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1355)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:314)
 at org.springframework.web.servlet.view.UrlBasedViewResolver.loadView(UrlBasedViewResolver.java:413)
 at org.springframework.web.servlet.view.AbstractCachingViewResolver.createView(AbstractCachingViewResolver.java:159)
 at org.springframework.web.servlet.view.UrlBasedViewResolver.createView(UrlBasedViewResolver.java:378)
 at org.springframework.web.servlet.view.AbstractCachingViewResolver.resolveViewName(AbstractCachingViewResolver.java:78)
 at org.springframework.web.servlet.DispatcherServlet.resolveViewName(DispatcherServlet.java:1190)
 at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1139)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
 at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
 at java.lang.Thread.run(Unknown Source)

If I remove the javascript script, the web page loaded succesfully. any one can explain why ? I think javascript doesn’t work if using velocity template.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T16:48:12+00:00Added an answer on May 17, 2026 at 4:48 pm

    In Velocity 1.7b1 new syntax #[[this is included in output but not parsed]]# was introduced:

    #[[
        $(document).ready(function() {
            ...
        });
    ]]#
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.