问题描述
我正在尝试仅使用JavaScript构建Handlebars应用程序。我注意到在那里有文档,他们初始化使用:
var source = $(#entry-template)。html ();
这一步是必需的还是只有使用原生Javascript才有办法?
不,它不需要jQuery。
只有人们更喜欢jQuery是因为jQuery执行各种操作的易用性。它节省了大量的时间&额外的努力。
使用带简单javscript的句柄将需要额外的努力。如果你有足够的时间,那么你应该尝试用普通的JavaScript。
下面给出的链接可能有助于更好地理解事物 -
I'm trying to build a Handlebars app using only JavaScript. I've noticed in there documentation, they initialize using:
var source = $("#entry-template").html();
Is this step required or is there a way around it using only native Javascript?
No, it doesn't require jQuery.
Only reason why people prefer jQuery is because of ease of use with which jQuery perform various operations. It saves lots of time & additional effort.
Using handlebars with plain javscript will require some extra effort. If you have enough time then you should try out things with plain JavaScript.
Below given links might be of some help to understand things better -
http://code.tutsplus.com/tutorials/handlebarsjs-a-behind-the-scenes-look--net-32678
这篇关于Handlebars是否需要jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!