Using globalstorage is deprecated. use localstorage instead

I received this message while running some javascript programs, and after some Google searches, I have no idea what this means or how I am causing this error. I am including the code below, can someone explain this to me or point me to a resource on how to fix it or what happens in general? The strange thing is that I have different code, like this part in my program, and it never gives me errors about them, so I really got confused. In addition, I get this error only when firebug starts, otherwise wise it just does not work and the error message is not displayed. I also tried it in Chrome and had the same problems, no error messages, but the code does not work.

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

Here is another one of my methods, it's basically the same thing, but it works great. And if that matters, all of these variables are global variables declared at the beginning of my file, like var foundTextArrayPosition = 0; eg.

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();
  }
}
+3
source share
3 answers

This is an obsolete error in Firefox 9. globalstorage- 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 contains additional information.

+6
source

, , , jQuery jzaefferer.github.com/jquery-validation/jquery.validate.js jQuery 1.7 0,1

: $(document).ready contexts. noConflict . , . !

:

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

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

});
}); 

. .

+1

, , .

, jQuery:

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

$(document).ready(function() {

- , href jQuery.js...!

0

Source: https://habr.com/ru/post/1540929/


All Articles