Check if localStorage is available

后端 未结 8 1522
悲哀的现实
悲哀的现实 2020-11-27 02:34

I know there has been many questions about checking for localStorage but what if someone manually shuts it off in their browser? Here\'s the code I\'m using to

8条回答
  •  借酒劲吻你
    2020-11-27 03:24

    Use this to check localStorage is set or not. Its help you to get status of Localstorage.

        if( window.localStorage.fullName !== undefined){
    
               //action
       }else{
              }
    

提交回复
热议问题