0

I'm using require.js with Backbone in ordrer to load my differents views.

In order to define the view I'm using this piece of script that is launched by my Router:

var view = require([
  'hbs!tpl/'+name,
   'views/'+name,
   data.path       
], function(Tpl,module,data){

       options.template = Tpl;
       options.data = data;
       return new module(options);
});    

The Backbone view receive the usefull options like the compiled template and the Model definition.

Is there a way to remove the script added by Require.js into the head tag when I remove my Backbone view ?

4

1 回答 1

1

删除 Require.js 添加的脚本标签不会卸载 javascript。

我的意思是删除这个脚本标签是没有用的。您只是不应该关心这一点,它不会改变您页面的反应方式。

于 2013-10-09T14:53:00.013 回答