javascript - Unexpected behavoiur of define of requirejs -
This code is working
define (['jquery', 'underscore ',' Backbone '], function ($, _, backbone, home_typeplate) {var Homeview = backbone view.extension ({render: function} {warning (' ABCD ');}}); homeview;};); This code is not working
define (['jquery', 'underscore', 'backbone', 'text! Module / home / Home_teletlet.html '], function ($, _, backbone, home_tyleplatform) {var Homeview = Backbone view.extension ({render: function} {alert (' ABCD ');}}); Return homeview;}); webroot / modules / home / home_template.html Like my directory structure, what could be the problem?
Thanks
The problem can occur in two possible places:
1) The error in the path (you can check in firebug or any other tool in the network tab, check 404 errors) This template or some other scripts can actually be placed in the wrong folder.
2) Error in template syntax - In case of underscore, make sure your template is & lt; Script type = "template" & gt; .
Comments
Post a Comment