shelllgd 发表于 2013-1-29 11:37:37

Ajax应用1

function GetXmlHttpObject(){var xmlHttp=null;try    {    // Firefox, Opera 8.0+, Safari    xmlHttp=new XMLHttpRequest();    }catch (e)    {    // Internet Explorer    try      {      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      }    catch (e)      {      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      }    }return xmlHttp;}

var url = "";url = "jkhtAjaxAction.do?operFlag=checkSavexmlHttp = createXMLHttpRequest();xmlHttp.onreadystatechange = function handleStateChange() {if (xmlHttp.readyState == 4) {if (xmlHttp.status == 200) {                           var value = xmlHttp.responseText;      }}};xmlHttp.open("GET", url, true);xmlHttp.send(null);

response.setContentType("text/html");response.setHeader("Cathe-Control", "no-cache");response.setHeader("Pragma", "no-cache");if ("checkSave".equals(operFlag)) {}response.getWriter().println(returnflag);
页: [1]
查看完整版本: Ajax应用1