---
title: "JSON 未定义"
author: "ttling"
date: "2015-09-08T19:51:19Z"
tags: []
categories: ["Web前端"]
slug: "json"
draft: false
lastmod: "2015-09-08T19:52:07Z"
id: 2241812
url: "https://ttling.iteye.com/blog/2241812"
---

解决在IE8中无法使用原生JSON的问题

解决
       首先说原因，微软文档的Requirements:Note中已经说的很清楚，翻译成中文意思大致如下:JSON是包含在JScript 5.8中，而为了向下兼容ie8只有在文档模式是”Internet Explorer 8 Standards”的时候才使用JScripte 5.8,其他时候使用JScripte 5.7特性。因此如果文档模式没有声明为”Internet Explorer 8 Standards”是找不到JSON对象的。
       那如何声明”Internet Explorer 8 Standards”呢，根据另一篇微软文档，有两种方式实现：

1. 在文档头中添加<meta http-equiv="X-UA-Compatible" content="IE=8" > 2. 使用<!DOCTYPE>来声明文档 
这两种方式都是告诉ie8浏览器以Internet Explorer 8标准模式显示内容，同时使用ie8的最新特性。

2、加上json.js让浏览器识别
转自<http://www.iitshare.com/ie8-not-use-native-json.html>