extjs为什么onReady方法总是报错??JavaScript和css都没导错,求各位高手帮帮忙!!!!!
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="../ext-3.2.0/ext-all.js" type="text/javascript"></script>
<script src="../ext-3.2.0/adapter/ext/ext-base.js" type="text/javascript"></script>
<link href="../ext-3.2.0/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
Ext.namespace("Ext.dojo");
var person=null;
function button_click(){
alert(1231);
person.setName(prompt("请输入姓名",""));
person.setSex(prompt("请输入性别",""));
}
Ext.onReady(function(){
alert(131);
var name=Ext.get("text1");
var sex=Ext.get("sex1");
person=new Ext.dojo.Person();
person.on("namechange",function(person,old,_new){
name.dom.value=_new;
});
person.on("sexchange",function(person,old,_new){
sex.dom.value=_new;
});
person.on("namechange",function(person,old,_new){
document.title=_new ;
});
});
alert(456);
Ext.dojo.Person=function(){
this.addEvents("namechange","sexchange");
}
Ext.extend(Ext.dojo.Person,Ext.util.Observable,{
name:"",
sex:"",
setName:function(_name){
if(this.name!=_name){
this.fireEvent("namechange",this,this.name,_name);
this.name=_name;
}
},
setSex:function(_sex){
if(this.sex!=_sex){
tis.fireEvent("sexchange",this,this.sex,_sex);
this.sex=_sex;
}
}
});
</script>
<input type="text" name="text1" /><br/>
<input type="text" name="sex1" /><br/>
<input type="button" value="输入" onclick="button_click()" />
</body>
</html> 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="../ext-3.2.0/ext-all.js" type="text/javascript"></script>
<script src="../ext-3.2.0/adapter/ext/ext-base.js" type="text/javascript"></script>
<link href="../ext-3.2.0/resources/css/ext-all.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
Ext.namespace("Ext.dojo");
var person=null;
function button_click(){
alert(1231);
person.setName(prompt("请输入姓名",""));
person.setSex(prompt("请输入性别",""));
}
Ext.onReady(function(){
alert(131);
var name=Ext.get("text1");
var sex=Ext.get("sex1");
person=new Ext.dojo.Person();
person.on("namechange",function(person,old,_new){
name.dom.value=_new;
});
person.on("sexchange",function(person,old,_new){
sex.dom.value=_new;
});
person.on("namechange",function(person,old,_new){
document.title=_new ;
});
});
alert(456);
Ext.dojo.Person=function(){
this.addEvents("namechange","sexchange");
}
Ext.extend(Ext.dojo.Person,Ext.util.Observable,{
name:"",
sex:"",
setName:function(_name){
if(this.name!=_name){
this.fireEvent("namechange",this,this.name,_name);
this.name=_name;
}
},
setSex:function(_sex){
if(this.sex!=_sex){
tis.fireEvent("sexchange",this,this.sex,_sex);
this.sex=_sex;
}
}
});
</script>
<input type="text" name="text1" /><br/>
<input type="text" name="sex1" /><br/>
<input type="button" value="输入" onclick="button_click()" />
</body>
</html> 展开
1个回答
展开全部
<script src="../ext-3.2.0/ext-all.js" type="text/javascript"></script>
<script src="../ext-3.2.0/adapter/ext/ext-base.js" type="text/javascript"></script>困备
这两行写反了 应模尺亩该先导入ext-base.js 然后旦森再导入ext-all.js
<script src="../ext-3.2.0/adapter/ext/ext-base.js" type="text/javascript"></script>困备
这两行写反了 应模尺亩该先导入ext-base.js 然后旦森再导入ext-all.js
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询