Note that there are some explanatory texts on larger screens.

plurals
  1. PORequireJs text plugin doesn't appear to be loading template into DOM
    text
    copied!<p>I'm building an app with backbone/RequireJs on the front end and node/express on the backend. All written in CoffeeScript. I'm having trouble getting HTML template files to load properly with the text! plugin.</p> <p>My Config is a s follows:</p> <pre><code> require.config paths: app: 'app' jquery: 'libs/jquery-1.7.1' jqueryTmpl: 'libs/jquery.tmpl' jqueryUI: 'libs/jquery-ui-1.8.18.custom.min' underscore: 'libs/underscore.amd' order: 'libs/order' backbone: 'libs/backbone.amd' handlebars: 'libs/handlebars' bootstrap: 'libs/bootstrap/js/bootstrap' marionette: 'libs/backbone.marionette' modelbinding: 'libs/backbone.modelbinding' validation: 'libs/backbone.validation' jqueryQtip: 'libs/jquery.qtip' utils: 'utils' jqueryDatatables: 'libs/datatables/jquery.dataTables' DT_bootstrap: 'libs/datatables/DT_bootstrap' user_maintenance: 'templates/tmpl.user.maintenance' require [ "require", "jquery", "underscore", "backbone", "order!jqueryTmpl", "order!marionette", "order!validation", "app" ] </code></pre> <p>This is the start of one of my views :-</p> <pre><code>define (require) -&gt; Backbone = require 'backbone' Backbone.ModelBinding = require 'modelbinding' require 'jqueryUI' require 'jqueryQtip' require '../../scripts/text!user_maintenance.html' Utils = require '../../scripts/Utils.js' class UserMaintenanceView extends Backbone.Marionette.ItemView template: "#tmpl-user-maintenance" className: "row" . . . </code></pre> <p>If I look at the network tab in Chrome developer tools, the <code>/scripts/templates/tmpl.user.maintenance.html</code> file has been loaded via a <code>GET</code>. Clicking on it shows the contents that appear like so. (I removed the contents for brevity, its just HTML)</p> <pre><code>&lt;script type="text/x-jquery-tmpl" id="tmpl-user-maintenance"&gt; &lt;/script&gt; </code></pre> <p>I don't get any script errors, but the template doesn't appear in the DOM and my view is not rendered. If I simply paste the HTML template into the main HTML file and don't try to load with the text plugin everything works fine. But I want to break my templates into separate files. </p> <p>Any idea what I'm doing wrong? </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload