FileReader and JSON objects not defined in ie11

烈酒焚心 提交于 2019-12-01 04:49:10

问题


Whenever trying to open a page running a javascript code using FileReader and JSON upon page initialization, ie11 reports "FileReader is not defined", and later "JSON is not defined". The head of HTML file is as follows:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>LogViewer</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="css/slick.grid.css" type="text/css"/>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" type="text/javascript"></script>
</head>

Everything works fine in FF and Chrome. Any ideas?


回答1:


Add <meta http-equiv="X-UA-Compatible" content="IE=edge" /> as the first tag of the header to be sure. IE loves to go to compatibility mode even if a HTML5 doctype is present under certain circumstances (especially on intranet files when the computer is in a domain).

You can use the developer tools (F12) to check what mode you are running in.



来源:https://stackoverflow.com/questions/20577007/filereader-and-json-objects-not-defined-in-ie11

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!