extjs报错

internet explorer cannot open the internet site operation aborted

在IE 7 及以下版本报此错误,

(中文错误: ”Internet Explorer无法打开internet站点,已终止操作“)

而且页面无法打开。

但是在chrome 和 firefox 已经 IE 8(和以上版本) 都是正常的。

原因基本上可能有两个:

1. 页面标签不匹配, 比如 <div> 有开始标签, 却少了 </div> 的结束标签

2. 在页面还没有 load完成之前就往页面元素中append 子元素。

Ext js 中典型例子就是不在 Ext.onReady 里面创建组件。

Expected identifier,String or number

 

[javascript]  view plain  copy
 
  1. Ext.create('Ext.window.Window', {  
  2.     title: 'Test Window',  
  3.     height: 580,  
  4.     width: 600,  
  5.     layout: 'fit',  
  6.     html: 'This is Test Window!',  
  7. }).show();  


以上这段,只是在IE中不正常, 并且不正常。

 

删除 html 配置项最后的 逗号就可以了。

看起来是IE与语法的验证更严格一些。

 

console

开发的时候总是喜欢使用

console.log()

的方式在控制台打印一些信息,但是在IE的浏览器中并没有这个对象。

所以使用console 之前需要做非空的判断

if(typeof(console)!="undefined"&&console!=null)

猜你喜欢

转载自zengshaotao.iteye.com/blog/2388728