一直在用一款jQuery插件,现在着手把所有代码都用SeaJS封装后,发现其他jq插件都能正常工作,唯独jTemplates不行。
http://jtemplates.tpython.com调用代码为:var $ = require('jquery');require('jtemplates/jquery-jtemplates.seajs')($);但在$对象下都没有jTemplates对象。最后找到问题原因了。jTemplates在返回jQuery对象前增加了一个判断语句if (window.jQuery && !window.jQuery.createTemplate) { 代码段 };解决办法:用未压缩代码删除判断语句后压缩,搞定。
if (window.jQuery && !window.jQuery.createTemplate) { 代码段 };
把 if 去掉就好。因为这个 if,导致在 CMD 环境下,始终为 false,进不去。
--
You received this message because you are subscribed to the Google Groups "seajs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seajs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.