Uncaught SyntaxError: Unexpected token <on line 1 http: // localhost: 25194 /

In the Backbone.Marionette web application, I copied the view resource from one view to another and I get an unexpected token error when the web application loads. The view definition is similar to what you see below. I simply translate one of the view definitions from this page to another definition page (Marionette.Layout).

define([
  'app',
  'lib/underscore',
  'lib/backbone',
  'lib/backbone.marionette',
  'lib/Backbone.ModalDialog',
  'lib/alertify',
  'text!modules/header/templates/mytemplate.html',
  'modules/header/views/another',   
  'modules/header/views/andanother'],
function(App, _, Backbone, Marionette, btm, alertify, template, AnotherView, AndAnotherView) {
  var MyView = Marionette.CompositeView.extend({
   ...

I used to track this type of error to a foggy route; fixing the route solved the problem, but this does not seem to be the problem here. There, the error was that the infrastructure tried to map JSON to the template, but received an error message with html formatting instead of data.

; , . : window.onError?

( ), , , , .

+4
1

" <", . , , HTML JSON.

+4

Source: https://habr.com/ru/post/1525499/


All Articles