Extjs之TypeError: Element.prototype.styleHooks is not an object or null

解决ExtJS加载冲突
本文介绍了一种在使用ExtJS框架时遇到的加载冲突问题及其解决方案。通过调整JavaScript文件的加载顺序,避免了浏览器中因重复加载导致的错误。
简单的写了一个extjs的入门页面

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>MyTESToR here</title>
<link rel="stylesheet" href="./ext/resources/css/ext-all.css">
<script src="./ext/ext-all.js"></script>
<script src="./ext/bootstrap.js"></script>
<!--<jwr:style src="/bundles/all.css" />
<jwr:script src="/bundles/lib.js"/>
-->
</head>
<body>
<script type="text/javascript">
Ext.onReady(function(){
if(Ext.BLANK_IMAGE_URL.substr(0,4)!="data"){
Ext.BLANK_IMAGE_URL="./images/s.gif";
}
new Ext.Viewport({
layout:'fit',
items:[{
xtype:"panel",
title:"welcome",
html:"<h1> hello world</h1>"
}]

})
})
</script>
</body>
</html>


在ff中浏览的时候,一直页面出不来,并且在console端报如下的错误:
[color=red][b][b]TypeError: Element.prototype.styleHooks is not an object or null


...alStyleHooks90 = verticalStyleHooks90 = Ext.Object.chain(Element.prototype.style...


ext-all-dev.js (line 29423, col 64)
TypeError: Ext.fly(...).addCls is not a function


...ush(c+"strict")}else{k.push(c+"quirks")}Ext.fly(n,"_internal").addCls(k)}Ext.fly...


ext-all.js (line 18, col 112123)[/b][/b][/color]


然后google了一些原来是重复的js加载到来的冲突导致的。 把灰色部分去掉即可,因为bootstrap.js在启动的时候会自动根据当前是开发环境还是production环境来决定加载ext-all.js还是ext-all-debug.js,当你写了两个的时候,ff就出现加载冲突,导致错误。
[color=gray]<script src="./ext/ext-all.js"></script>[/color]
<script src="./ext/bootstrap.js"></script>

这样的话,页面就可以加载成功了
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值