use of globalstorage is deprecated. please use localstorage instead

12,678

Solution 1

This is a deprecation error in Firefox 9. globalstorage was a way to store data in Firefox, but HTML5 introduced localstorage, which is now the preferred way (using window.localStorage).

https://developer.mozilla.org/en/DOM/Storage has more information.

Solution 2

Probably not related to the issue above but I will put it here for the search engines.

I got the same error message while doing some simple jQuery:

Use of globalStorage is deprecated. Please use localStorage instead.
[Break On This Error]   

$(document).ready(function() {

It was however due to forgetting to actually include the link href to the jQuery.js file...!

Solution 3

I got the same error message and found a solution and perhaps the underlying cause of conflict, I was using the jQuery validate function in the jzaefferer.github.com/jquery-validation/jquery.validate.js library along with jQuery 1.7.1

The problem: I used $(document).ready with two different contexts. One with the noConflict wrapper and one without. By keeping both the same, the error message went away. Hooray!

The wrapper:

jQuery.noConflict();
jQuery(function($) {
$(function() {

  $(document).ready(function() { ...}

});
}); 

See also this post on my blog.

Share:
12,678
convergedtarkus
Author by

convergedtarkus

Updated on June 04, 2022

Comments

  • convergedtarkus
    convergedtarkus almost 2 years

    I got this message when doing some javascript programming, and after some google searches, I have no idea what it means, or how i cause this error. I'm including the code below, can someone explain it to me or point me to a resource on how to fix it or what is happening at all? The weird thing is that I have other code just like this part in my program, and it never gives me errors about them, so i'm really confused. Also, I only get this error to display with firebug running, else wise it just doesn't work and no error message is displayed. I also tried it in Chrome, and had the same issues, no error message but the code doesn't work.

    foundTextFn = function(){
    console.log('fire');
    if (foundTextArrayPosition != foundTextArray.length){
        writeText(foundTextArray[foundTextArrayPosition],"happy");                      
        foundTextArrayPosition += 1;
      }
      foundTextFnTimer=setTimeout("foundTextFn()",4000);
    }
    

    Here is another of my methods, it is basically the same thing, but it works fine. And if it matters, all of these variables are global variables declared at the start of my file as var foundTextArrayPosition = 0; for example.

    awayFn = function(){
    if (awayArrayPosition != awayArray.length){
            if (changeAwayState){
                changeAwayState = false;
                writeText(awayArray[awayArrayPosition],"normal");
                awayArrayPosition ++;
                temp = pickRandomSpot();
                randomX = temp[0];
                randomY = temp[1];
            }
            else{
                changeAwayState = true;
            }
            awayTimer=setTimeout("awayFn()",10000);
        }
    else{
        abandoned = true;
        whyGoneArrayPosition = 0;
        whyGoneFn();
      }
    }