html5 - 为什么Edge浏览器不支持localstorage?
天蓬老师
天蓬老师 2017-04-17 13:10:03
0
3
1094

连IE8及以上都能够支持,为什么Edge不能够支持?

if(window.localStorage){
 alert('This browser supports localStorage');
}else{
 alert('This browser does NOT support localStorage');
}


下面是Edge版本:

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
Peter_Zhu

EDGE does not support localStorage in local files (this seems to be the case for IE10 and 11)
You need to build a server and try again
Or you can open F12 directly in the segmentfault webpage Try again and it will be supported

Peter_Zhu

It is supported, but your code cannot tell whether it is supported!
You'd better check the context of your code, the introduction method, etc.

Check whether it can output in the browser debugging console, F12-Console, enter localStorage below, and press Enter.

刘奇

I copied your code and ran it in Edge, the results are as follows:

It can be seen that it is supported. Is there something wrong with your step? Try printing window.localStorage in cosole

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template