var DetailsView = View.extend({ events: { }, action: "/api/thread/", initialize: function(opt){ this.comments = new CommentsView ({ parent: this }) this.files = new FilesView ({ parent: this }) }, load: function(id){ id = id.replace(/\D/g, "") $.get(this.action + id, this.populate.bind(this)) }, populate: function(data){ $("h1").html(data.thread.title) this.comments.load(data.comments) this.files.load(data.files) }, success: function(){ window.location.href = "/index" }, })