ie11中未定义的FileReader和JSON对象 [英] FileReader and JSON objects not defined in ie11

查看:335
本文介绍了ie11中未定义的FileReader和JSON对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当尝试在页面初始化时使用FileReader和JSON打开运行运行javascript代码的页面时,ie11都会报告未定义FileReader",随后会报告未定义JSON". HTML文件的标题如下:

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>

在FF和Chrome中一切正常.有什么想法吗?

Everything works fine in FF and Chrome. Any ideas?

推荐答案

添加<meta http-equiv="X-UA-Compatible" content="IE=edge" />作为要确保的标头的第一个标签.即使在某些情况下存在HTML5 doctype(尤其是当计算机位于域中时,在内联网文件上),IE仍喜欢进入兼容模式.

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).

您可以使用开发人员工具(F12)来检查您正在运行的模式.

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

这篇关于ie11中未定义的FileReader和JSON对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆