浏览 1494 次
锁定老帖子 主题:构件自己的JS函数库
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2009-02-27
构件自己的函数库首先将自己所见的JS函数的包含进JSP页面中,具体如下:
<script language="JavaScript" type="text/javascript" src="example.js"></script> <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>构件自己的Ajax函数库</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <script language="JavaScript" type="text/javascript" src="example.js"></script> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> This is my JSP page. <br> <select id="product" size="1" onchange="order()"> <option value="1" selected>苹果</option> <option value="2">西瓜</option> <option value="3">荔子</option> </select> 数量:<input id="num" size="10" type="text"><br> 单价:<input id="price" size="10" type="text"> 总价:<input id="result" size="10" type="text"> </body> </html> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |