IE下报 Expected identifier,string or number 错误的解决方法
2013-11-19 18:25
906 查看
在IE中,如果脚本中出现了IE无法解决的代码时,就会弹出窗口报“当前页面的脚本发生错误”,并在下方显示具体的错误。
今天项目中的代码在IE7下报了在79行有Expectedidentifier,stringornumber错误。
这段代码乍看没有什么问题,后来我将title属性后面的“,”号删除后,页面就不报错了。
原因是在定义{"xxx":xxx}的变量时,最后一个属性后面能加“,"号,在IE下会解析错误,在chrome等浏览器下会忽略。
今天项目中的代码在IE7下报了在79行有Expectedidentifier,stringornumber错误。
varapi=$.dialog({ id:'appForm', width:100, height:350, title:"xxx", }); $.post(“”,"function(data){ api.content(data); });
这段代码乍看没有什么问题,后来我将title属性后面的“,”号删除后,页面就不报错了。
原因是在定义{"xxx":xxx}的变量时,最后一个属性后面能加“,"号,在IE下会解析错误,在chrome等浏览器下会忽略。
相关文章推荐
- IE6,IE7,IE8下报JS错误:expected identifier, string or number的原因及解决的方法
- IE6,IE7,IE8下报JS错误:expected identifier, string or number的原因及解决办法
- IE7 的JS错误:Expected identifier, string or number
- ie6 ie7下报脚本错误"Expected identifier, string or number" 的原因和解决方法
- IE6,IE7,IE8下报JS错误:expected identifier, string or number的原因及解决办法
- 网页报“缺少标识符 字符串或数字”(Expected identifier,string or number)错误的原因及解决办法
- IE7 下执行jquery, 报错IE error: Expected identifier, string or number 的解决办法
- python出现,coercing to unicode need string or buffer nonetype found python 错误的解决
- IE网页js语法错误2行字符1、FF中正常的解决方法
- IE网页js语法错误2行字符1、FF中正常的解决方法
- Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] No such file or directory’错误的解决方法
- 解决js书写不规范引起的Expected identitifier,string or number
- Hibernate继承映射的“Could not format discriminator value to SQL string”错误解决方法
- ssh免密码登陆设置时Authentication refused: bad ownership or modes错误解决方法
- coolite出现Unterminated string constant错误解决方法
- The method contains(CharSequence) from the type String refers to the missing type CharSequence错误解决方法
- apue源码make:/usr/include/bits/timex.h:31:7: 错误:expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘__attribute__’ be的解决方法
- jsp中上传大文件(200M已测试),存到数据库,易发生连接超时的ie找不到网页的错误,其解决方法。略写代码,参考(.net修改代码应该可以,改天修改)
- 记录一些意外:ORA-00020:maximum number of processes (1500) exceeded 错误解决方法
- IE错误一般能解决的方法