向我展示了一个技巧-不是将数据放在datafile.json中并使用ajax加载它,而是将数据封装在datafile.js中的单个对象中,例如var data ={ //all data goes here然后,将datafile.js作为外部脚本加载到HTML头中
它工作得很好,就像对象是用ajax加载的一样,有什么缺点吗?
我试图将引导标记场封装为一个聚合物元素,但是得到了以下错误/跟踪:
Error: An attempt was made to reference a Node in a context where itat GeneratedWrapper.mixin.insertBefore (http://localhost:3005/ShadowDOM/src/wrappers/Node.js:266:30)<anonymous> (http://ajax<