Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7726245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:09:56+00:00 2026-06-01T05:09:56+00:00

I am getting the error: object render has no method apply for the below

  • 0

I am getting the error:

object render has no method apply for the below code.

What can be the reason ?
The html page doesnt contain any code except the link for the javascript.
what should I do to remove the error ?

(function($) {

    window.Book = Backbone.Model.extend({});

    window.Library = Backbone.Collection.extend({

        model: Book

    }); // end of Collection
    window.LibraryView = Backbone.View.extend({

        el: $('body'),

        events: {
            'click button#btn_add': 'btn_add'

        },

        initialize: function() {
            $(this.el).append("View initialized");
            _.bindAll(this, 'render', 'btn_add');
            this.collections = new Library();
            this.collections.bind('add', 'render', this);
            this.startingDisplay();

        },
        startingDisplay: function() {
            $(this.el).append("<input type='text' id='t1' /><button id='btn_add'>Add</button>");

        },

        btn_add: function() {

            book = new Book({
                title: "first"
            });
            alert("Name : " + book.get('title'));
            this.collections.add(book);
        },

        render: function() {
            alert("render called");

        },

    }); // end of LibraryView
    libraryview = new LibraryView();

})(jQuery);​
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:09:57+00:00Added an answer on June 1, 2026 at 5:09 am

    You are not using the correct syntax to bind the add collection event. Use:

    // this.collections.bind('add', 'render', this);
    this.collections.bind('add', this.render, this);
    

    The second parameter is expected to be a callback (a function).

    DEMO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting strange error 'int' object has no attribute 'startswith' I haven't used the
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
I keep getting the following error: 'function' object has no attribute 'objects' for Like.
I'm getting the NRE error that says: Object reference not set to an instance
I'm getting a Call to a member function fetchColumn() on a non-object error when
I am getting the object reference error in this line: emp[count].emp_id = int.Parse(parts[0]); in
I am getting the following error when trying to update an object using nhibernate.
I'm getting the following error when calling a stored procedure: Cannot find the object
I'm getting a bad error. When I call delete on an object at the
I keep getting this error on my views. I can't work it out as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.