向我展示了一个技巧-不是将数据放在datafile.json中并使用ajax加载它,而是将数据封装在datafile.js中的单个对象中,例如var data ={ //all data goes here然后,将datafile.js作为外部脚本加载到HTML头中
它工作得很好,就像对象是用ajax加载的一样,有什么缺点吗?
我认为这更像是jquery集成问题,但这里是我的问题/ bug。我试图将引导标记场封装为一个聚合物元素,但是得到了以下错误/跟踪:
Error: An attempt was made to reference a Node in a context where it<anonymous> (http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.js</