简体   繁体   中英

mechanics and meaning of JavaScript library syntax: ${ value }

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM