引用js文件,写在jsp文件中不可以--其实也可以,切记 先定义方法,后再调用,js毕竟不太智能
var wj=function()
{
return {
hello:function(){
alert("wj");
}
};
}();
wj.helloa=function()
{
return {
hello:function(){
alert("wj");
}
};
}();
jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Insert title here</title>
<!-- 引入extjs的css样式文件 -->
<link rel="stylesheet" type="text/css"
href="extjs/resources/css/ext-all.css">
<script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="extjs/bootstrap.js"></script>
<script type="text/javascript" src="extjs/promotionParticipants.js"></script>
<script type="text/javascript" src="extjs/promotionRequest.js"></script>
<script type="text/javascript">
Ext.onReady(function() {
//Ext.Msg.alert('提示', '逗号分隔参数列表');
Ext.MessageBox.alert("a", "b");
function test()
{
var currentstate = "THIS_IS_OK";
alert(currentstate);
}
});
//participantTablePanelHandler.loadParticipantsTable();
//wj.hello();
wj.helloa.hello();
</script>
</head>
<body>
</body>
</html>