Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Backbone.js master class: localStorage, can't get it working

I'm watching through this series: http://teamtreehouse.com/library/html5-mobile-web-applications/html5-mobile-javascript-backbone-collections

I've tried to follow along and for the most part it's working but I'm stuck at the bit where we're supposed to add a binding to collection.localStorage. Seems like localStorage doesn't extend Backbone.Events anymore so I can't trigger, nor can I bind onto localStorage.

But even more, I can't seem to make collection#fetch work at all. Even the simplest case where I know I have some data in localStorage and only the collection defined, collection#fetch still doesn't work. :(

Thanks for any help

1 Answer

The version of localStorage in the file linked in the Master Class seems to be out of date. The video said that it would be updated but it doesn't seem that way. So I updated to the latest version of backbone.localStorage.js but of course it's way too recent I think.

Has anyone gotten this working lately? What version of localStorage.js did you use?