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

  • SEARCH
  • Home
  • 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 8642741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:51:19+00:00 2026-06-12T11:51:19+00:00

I have been looking at Javascript templating engines trying to find a way to

  • 0

I have been looking at Javascript templating engines trying to find a way to have standard templates available on/offline.

Currently I’m kind of stuck at dustjs/linkedIn which would require to server-side pre-compile a template into a jsfile – difficult as I’m using Coldfusion8.

There are sparse links available on running Javascript in Coldfusion (example). So:

Question:
Is there an easy to use Javascript in Coldfusion? I’m not talking about toScript our <cfoutput><script>alert("hello")></cfoutput>, I want to run a javascript function like the dustjs compiler on the server in a cfscheduled task to take HTML templates and compile them from this:

  Hello {name}! You have {count} new messages.

to this:

(function() {
    dust.register("demo", body_0);

    function body_0(chk, ctx) {
    return chk.write("Hello ").reference(ctx.get("name"), ctx, "h").write("! You have ").reference(ctx.get("count"), ctx, "h").write(" new messages.");
    }
    return body_0;
})();

which is done in the dustJS compiler.js file (I think…). If it’s not possible, what are other options besides creating a “coldfusion compiler” which changes markup to compiled javascript?

Thanks for some toughts!

  • 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-06-12T11:51:20+00:00Added an answer on June 12, 2026 at 11:51 am

    Take a look at CFGroovy. Although targeting groovy, it’s really a way for CF to use the generic scripting features of Java (JSR-223) You ought to be able to start Rhino through this and run your code. In fact, Ben Nadel has an article on doing this.

    Althernatively, you could put node on your server and use cfexecute to run node to compile your templates.

    If you make it work, I’d consider not compiling on a schedule. Perhaps try one fo the following:

    • Compile as part of your build, if you have a defined build process.
    • Compile on demand, so your script URLs might be script.cfm?script=whatever.js and have CF check dates and either compile the template or
    • Use the DirectoryWatcher event gateway to monitor your script folder and compile-on-change.

    I like the third option best, as it’ll only compile on change, which is probably what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In trying to understand javascript constructors, I have been looking at this question .
I'm currently redesigning my website and have been looking into using JavaScript and jQuery.
We have been using javascript hashes a lot lately, and we've been looking for
I have been looking online to find documentation for the function in QTP and
I have been looking at the Thinktecture.IdentityModel.40 library as a way of handling the
I have been looking for a Javascript algorithms that gives me the week number
Introduction : Hello Everyone, I have been looking for days for a way to
I have been looking all day for a PHP or JavaScript solution to do
I have been looking into design patterns in Javascript and found http://tcorral.github.com/Design-Patterns-in-Javascript/Template/withoutHook/index.html to be
I have been looking for a simple way to allow a similar functionality to

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.