0

I've come across the following JavaScript code snippet in O'Reilly's JavaScript Web Applications:

// helper.js
var helper = {};
helper.formatDate = function(){ /* ... */ };

// template.html
<div>
  ${ helper.formatDate(this.date) }
</div>

However no reference to any particular JavaScript library is provided here. What is the likely meaning of the ${ ... } syntax and how does it work? Does this come from the use of any particular library? I've seen jQuery's $() notation where $ is a function but I've not seen $ followed by a curly bracket pair anywhere.

Thanks.

Jason Posit
  • 1,323
  • 1
  • 16
  • 36
  • It's just a placeholder in `template.html`. –  Jul 06 '13 at 08:55
  • Well, the puzzling thing is that once the function returns I expect to see something like ${2003-04-05} or something, which does not look like a variable name. How can a date value be a reasonable template variable name? – Jason Posit Jul 06 '13 at 09:06

1 Answers1

1

It might be from the old, no longer in development jQuery Tmpl library or some other template engine:

Community
  • 1
  • 1
elclanrs
  • 92,861
  • 21
  • 134
  • 171
  • It might indeed be but is there a successor to the defunct jQuery Tmpl library which uses the same syntax etc... ? – Jason Posit Jul 06 '13 at 09:08