SCRIPT1010:IE10中的预期标识符 [英] SCRIPT1010: Expected identifier in IE10
问题描述
在我的项目中,我正在使用Prototype JavaScript Framework 1.7.1
In my project I am using the Prototype JavaScript Framework 1.7.1
当我在Windows 7的IE10中加载网页时,出现以下错误消息:
SCRIPT1010:预期的标识符行1字符9指向下面的我的测试HTML页面中的<!DOCTYPE html>
:
When I load the web page in IE10 on Windows 7 I get the error message below:
SCRIPT1010: Expected identifier line 1 character 9 which points to <!DOCTYPE html>
in my test HTML page below:
<!DOCTYPE html>
<html>
<head>
<title>My webpage title</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js'></script>
</head>
<body>
just testing
</body>
</html>
HTTP请求标头
GET /test.html HTTP/1.1[CRLF]
Host: www.mydomain.com[CRLF]
Connection: close[CRLF]
User-Agent: Web-sniffer/1.0.44 (+http://web-sniffer.net/)[CRLF]
Accept-Encoding: gzip[CRLF]
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[CRLF]
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6[CRLF]
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
Cache-Control: no-cache[CRLF]
Referer: http://web-sniffer.net/[CRLF]
HTTP响应标头
Name Value Delim
Status: HTTP/1.1 200 OK
Server: webhost
Date: Tue, 26 Mar 2013 10:07:56 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
Vary: Accept-Encoding,User-Agent
Last-Modified: Tue, 26 Mar 2013 10:07:29 GMT
Cache-Control: max-age=3600, public, must-revalidate, proxy-revalidate
Expires: Tue, 26 Mar 2013 11:07:56 GMT
Pragma: public
CF-RAY: 553096521a6047f
Content-Encoding: gzip
有人知道是什么原因导致此错误,或者这是Prototype 1.7.1中的错误吗?
Does anyone know what is causing this error or is this a bug in Prototype 1.7.1?
推荐答案
See this pull request on Github https://github.com/sstephenson/prototype/pull/93
PrototypeJS每次加载时都会进行一些功能检测,并且Internet Explorer 10已调整了一些Javascript语法的解析方式并引发了该错误.
PrototypeJS does some feature detection everytime it loads and Internet Explorer 10 has adjusted the way some of the Javascript syntax is parsed and throws that error.
PrototypeJS正在进行检测,以了解如何处理作为标记属性(例如onclick方法)的传递函数,而IE10 JavaScript解析器将其检测为语法错误.
PrototypeJS is doing a detection to see how to handle passing functions as tag attributes (like an onclick method) and the IE10 javascript parser detects that as a syntax error.
如果您查看Github中的pull请求,它将为您显示一个创可贴以及使Internet Explorer 10感到满意的完整修复程序.
If you look at the pull request in Github it will show you a band-aid as well as a full fix to make Internet Explorer 10 happy.
请传播这个词.
2013-05-17更新引用的请求请求已关闭,并且已将修复程序集成到PrototypeJS github的master分支中
2013-05-17 UPDATE The pull request referenced has been closed and a fix has been integrated into the the master branch of the PrototypeJS github
https://github.com/sstephenson/prototype
请从此处克隆并更新脚本.
Please clone from there and update your scripts.
2014-05-01更新的修复程序已在PrototypeJS 1.7.2中发布
2014-05-01 UPDATE The fix for this has been released in PrototypeJS 1.7.2
http://prototypejs.org/2014/04/18 /prototype-1-7-2/
这篇关于SCRIPT1010:IE10中的预期标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!