小编eag*_*eal的帖子

使用Backbone.View时,返回"parent.apply不是函数"错误

考虑这个标记

<div id="controls" class="controls">
  <a href="#">Home</a> - 
  <a href="#/get">get</a> - 
  <a href="#/new">new</a>
  <input type="text" val="" id="input">
</div>
Run Code Online (Sandbox Code Playgroud)

而这段javascript:

$(document).ready(function() {
  "use strict";

  // this is used on my code as root.App,
  // but the code was omitted here for clarity purposes
  var root = this,
  undefined;

  var controller = Backbone.Controller.extend({

    routes : {
      // static
    },
  });

  var view = new Backbone.View.extend({
    el : $('#controls'),
    events : {
      'click a' : 'updateOnEnter'
    },

    updateOnEnter : function(el) {
      alert('sss');
      return this; …
Run Code Online (Sandbox Code Playgroud)

backbone.js

30
推荐指数
1
解决办法
8161
查看次数

标签 统计

backbone.js ×1