Chinaunix首页 | 论坛 | 博客
  • 博客访问: 999601
  • 博文数量: 152
  • 博客积分: 4937
  • 博客等级: 上校
  • 技术积分: 1662
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-05 16:55
文章分类

全部博文(152)

文章存档

2013年(12)

2012年(6)

2011年(58)

2010年(43)

2009年(1)

2008年(15)

2007年(17)

我的朋友

分类: Java

2010-07-05 21:39:37

Context.xml

         maxWait="10000"  
        username="root"  password="a12345" 
        driverClassName="com.mysql.jdbc.Driver"  
       url="jdbc:mysql://localhost:3306/newspaper?useUnicode=true&characterEncoding=gbk&zeroDateTimeBehavior=convertToNull" />
             
 
 
<%@ page contentType="text/html; charset=gbk" %>
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ include file="include.jsp" %>
<%@ taglib prefix="c"  uri="" %>
<%@ taglib uri="" prefix="display" %>
<%@ taglib uri="" prefix="pg" %>
 
 
 
----------------------------------------

   
   
   
   
   修改
  
--------------------------------------
 

  
  
  
  
 首页
 前页
 
  
  
  ${pageNumber}
  

  
  ${pageNumber }
  

  

 

 下页
 尾页
 
-------------------------------------------
 
----------------------------------
 
 
document.getElementById("pageSize").options[1].selected=true;
----------------------------------
 
my.js
 
 
//Gets the browser specific XmlHttpRequest Object
function getXmlHttpRequestObject() {
 if (window.XMLHttpRequest) {
  return new XMLHttpRequest();
 } else if(window.ActiveXObject) {
  return new ActiveXObject("Microsoft.XMLHTTP");
 } else {
  alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?");
 }
}
function createAjaxObj(){
  var httprequest=false
  if (window.XMLHttpRequest)
  { // if Mozilla, Safari etc
    httprequest=new XMLHttpRequest()
    if (httprequest.overrideMimeType)
      httprequest.overrideMimeType('text/xml')
   }
   else if (window.ActiveXObject)
   { // if IE
     try {
       httprequest=new ActiveXObject("Msxml2.XMLHTTP");
     }
     catch (e){
       try{
          httprequest=new ActiveXObject("Microsoft.XMLHTTP");
       }
       catch (e){}
     }
   }else {
  alert("Your Browser don't support ajax");
 }
   return httprequest
}
//Our XmlHttpRequest object to get the auto suggest
var searchReq = createAjaxObj();
 
 
//Called from keyup on the search textbox.
//Starts the AJAX request.
function doRequestUsingGET(url,handleStateChange) {
 if (searchReq.readyState == 4 || searchReq.readyState == 0) {
  searchReq.open("GET", url, true);
  searchReq.onreadystatechange = handleStateChange;
  searchReq.send(null);
 }  
}
 
function handleDefault() {
   if(searchReq.readyState == 4){
    if(searchReq.status == 200){}
   }
  }
 
调用ajax的js函数:
function updateNumber(obj) {
            var url = "HistoryNumberServlet?id="+obj.tid+"&actualAmount="+obj.value+"&operator=amount";
            doRequestUsingGET(url,handleDefault);
            priceTotal();
        }
 
 
onclick="javascript:window.location.href='pager.do?command=addinput';"
 
--------------------------
 
function openWin(f,n,w,h,s){
   sb = s == "1" ? "1" : "0";
   l = (screen.width - w)/2;
   t = (screen.height - h)/2;
   sFeatures = "left="+ l +",top="+ t +",height="+ h +",width="+ w
     + ",center=0,scrollbars=" + sb + ",status=0,directories=0,channelmode=0";
   openwin = window.open(f , n , sFeatures );
  /*
   if (!openwin.opener)
    openwin.opener = self;
   openwin.focus();
  */
   return openwin;
  }
  
 
  function chkDel(){
   var flag = false;
   for (var i = 0; i < document.getElementsByName("chkDelete").length; i++) {
    if (document.getElementsByName("chkDelete")[i].checked) {
     flag = true;
    }  
   }
   if (!flag) {
    alert("请选择需要删除的报纸!");
    return;
   }
   if(confirm("确定要删除?")){
    with(document.getElementById("form1")){
     method = "post";
     action = "pager.do?command=del";
     submit();
    }
   }
  }
 
 
 
阅读(660) | 评论(0) | 转发(0) |
0

上一篇:日期格式化

下一篇:pagerAction(displaytag)

给主人留下些什么吧!~~