我正在尝试设置的这个网站似乎没有加载 js。我已经安装了 json 和 php-pear 并重新启动了 apache 等等。当我进入页面时,我看到的只是背景和横幅。
<html>
<head>
<link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css" />
<script type="text/javascript" src="../adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="../ext-all.js"></script>
<style type="text/css">
body
{
font-family: Arial, Verdana, sans-serif;
background-image: url(graphics/background_gradient.png);
background-repeat: repeat-x;
background-color: #374d5b;
margin: 0;
padding: 0 0 20px 0;
font-size: 13px;
color: #333;
text-align: center;
}
.root
{
width: 410px;
margin: 0 auto;
text-align: left;
background-color: #e6e6e6;
position: relative;
}
#header
{
background: #0e1d2f url(graphics/banner.png) no-repeat left;
height: 90px;
}
</style>
</head>
<body>
<div class="root">
<div id="header"></div>
</div>
<script type="text/javascript" src="login.js"></script>
</body>
</html>
我正在运行 CentOS 5
登录.js:
Ext.onReady(function(){
Ext.QuickTips.init();
var login = new Ext.FormPanel({
labelWidth:80,
url:'login.php',
frame:true,
title:'Please Login',
defaultType:'textfield',
monitorValid:true,
items:[{
fieldLabel:'Username',
name:'loginUsername',
allowBlank:false
},{
fieldLabel:'Password',
name:'loginPassword',
inputType:'password',
allowBlank:false
}],
buttons:[{
text:'Login',
formBind: true,
handler:function(){
login.getForm().submit({
method:'POST',
waitTitle:'Connecting',
waitMsg:'Sending data...',
success:function(){
Ext.Msg.alert('Status', 'Login Successful!', function(btn, text){
if (btn == 'ok'){
var redirect = './panel.php';
window.location = redirect;
}
});
},
failure:function(form, action){
if(action.failureType == 'server'){
obj = Ext.util.JSON.decode(action.response.responseText);
Ext.Msg.alert('Login Failed!', obj.errors.reason);
}else{
Ext.Msg.alert('Warning!', 'Authentication server is unreachable : ' + action.response.responseText);
}
login.getForm().reset();
}
});
}
}]
});
var win = new Ext.Window({
layout:'fit',
width:300,
height:150,
closable: false,
resizable: false,
plain: true,
border: false,
items: [login]
});
win.show();
});