Jump to content

Recommended Posts

I am using this tutorial here http://blog.shinetech.com/2011/08/05/building-a-shared-calendar-with-backbone-js-and-fullcalendar-a-step-by-step-tutorial/ to make a calendar using backbone.

 

The calendar is rendered via backbone with a function(see paragraph Bringing in Backbone code line 15).

 

The problem is that the calendar is not displayed/rendered.

Checking with the chrome devtools console I saw the following error:

 

Uncaught TypeError: Cannot call method 'each' of undefined

 

It refers to backbone-min.js and to this code here

 h.each(_, function(t) {        v.prototype[t] = function(e, i) {            var r = h.isFunction(e) ? e : function(t) {                return t.get(e)            };            return h[t](this.models, r, i)        }    });

Why that happens? I have not the slightest idea.

What could be possible wrong here?

Share this post


Link to post
Share on other sites

You need to figure out which line of your own code is making that happen. The debugger should allow you to see the call stack somehow when the error occurs. You used a feature of that library and passed it an undefined value somewhere.

Share this post


Link to post
Share on other sites

The problem was that I had not included underscore.js.

Share this post


Link to post
Share on other sites

The problem was that I had not included underscore.js.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...