首页 > 其他 > 详细

jq封装方法步骤

时间:2016-12-04 00:37:06      阅读:209      评论:0      收藏:0      [点我收藏+]
例子如下:

(function($) { var compiled = {}; $.fn.handlebars = function(template, data) { if (template instanceof jQuery) { template = $(template).html(); } compiled[template] = Handlebars.compile(template); this.html(compiled[template](data)); }; })(jQuery); $(‘#content‘).handlebars($(‘#template‘), { name: "Alan" });

jq封装方法步骤

原文:http://www.cnblogs.com/chenyangsuaige/p/6129830.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!