json.stringify does not process object methods

前端 未结 3 1138
别跟我提以往
别跟我提以往 2020-11-30 04:46

I am trying to develop an offline HTML5 application that should work in most modern browsers (Chrome, Firefox, IE 9+, Safari, Opera). Since IndexedDB isn\'t supported by Sa

3条回答
  •  忘掉有多难
    2020-11-30 05:24

    Does not fix functions as requested, but a way to store variables locally...

    
      
        Blank
        
      
      
        
        
      
    
    

    Keep all variables in object g. Example:

      g.arr=[1,2,3];
    
    • note some types, such as Date, you'll need to do something like:
      g.date=new Date(g.date);
    
    • stores locally per page: different pages have different gs

提交回复
热议问题