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 8018835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:13:26+00:00 2026-06-04T21:13:26+00:00

I am using Backbone.LocalStorage : http://jsfiddle.net/jiewmeng/grhz9/3/ $(function() { console.log(Backbone.LocalStorage); // undefined!! var Todo =

  • 0

I am using Backbone.LocalStorage: http://jsfiddle.net/jiewmeng/grhz9/3/

$(function() {
    console.log(Backbone.LocalStorage); // undefined!!
    var Todo = Backbone.Model.extend({});
    var Todos = Backbone.Collection.extend({
        model: Todo,
        localStorage: new Backbone.LocalStorage("todos")
    });
});​

The 1st console.log() gives undefined. Then there an error at the localStorage: ... line

Uncaught TypeError: undefined is not a function

Expected since Backbone.LocalStorage is undefined but why?

  • 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-04T21:13:27+00:00Added an answer on June 4, 2026 at 9:13 pm

    The backbone.localStorage-min.js you’re loading:

    http://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.0/backbone.localStorage-min.js

    looks like it is out of date and it doesn’t define Backbone.LocalStorage at all. The version of backbone.localStorage-min.js that you are using defines window.Store rather than Backbone.LocalStorage. If you switch to that (http://jsfiddle.net/ambiguous/grhz9/5/):

    var Todos = Backbone.Collection.extend({
        model: Todo,
        localStorage: new Store("todos")
    });
    

    then you can get past building your Todos collection. I don’t know how well things will work when you actually try to use it though. “Sun Aug 14 2011 09:53:55 -0400” is pretty much forever-ago in internet time so that version is rather antique.

    If you switch to the latest version from Github:

    https://raw.github.com/jeromegn/Backbone.localStorage/master/backbone.localStorage-min.js

    you’ll see that there are a few differences in the JavaScript and everything will start working when you use new Backbone.LocalStorage('todos'):

    http://jsfiddle.net/ambiguous/grhz9/4/

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

Sidebar

Related Questions

Using the following as an example: var Case = Backbone.Model.extend({ initialize: function(){ this.bind(error, function(model,
I'm using backbone.js, underscore.js and jQuery. I took the following sample code from http://jsfiddle.net/thomas/C9wew/6/
I am creating a contact Manager using backbone.js,this is my code $(document).ready(function() { var
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
I'm using backbone + backbone.localStorage to persist my data, and I get a wrong
Using Backbone.model, I would like to change the get method in order to get
I'm using Backbone.js have a segmented control-type UI element for each model's view. They
I'm using Backbone.js's routing . It generate urls for browsers like this: http://my-app.com/help For
I'm using Jerome's localStorage adapter with Backbone and it works great for collections. But,
Using Backbone.js I know it's highly recommended to set a model's property using the

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.