Handlebars是否需要jQuery [英] Does Handlebars require jQuery

查看:133
本文介绍了Handlebars是否需要jQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试仅使用JavaScript构建Handlebars应用程序。我注意到在那里有文档,他们初始化使用:

  var source = $(#entry-template)。html (); 

这一步是必需的还是只有使用原生Javascript才有办法?

解决方案

不,它不需要jQuery。

只有人们更喜欢jQuery是因为jQuery执行各种操作的易用性。它节省了大量的时间&额外的努力。

使用带简单javscript的句柄将需要额外的努力。如果你有足够的时间,那么你应该尝试用普通的JavaScript。



下面给出的链接可能有助于更好地理解事物 -



http: //code.tutsplus.com/tutorials/handlebarsjs-a-behind-the-scenes-look-net-32678

http:// www。 raymondcamden.com/2012/04/19/Demo-of-Handlebars-and-why-you-should-consider-a-templating-engine


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

http://www.raymondcamden.com/2012/04/19/Demo-of-Handlebars-and-why-you-should-consider-a-templating-engine

这篇关于Handlebars是否需要jQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆