锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品视频在线视频,欧美日韩精品久久,日韩国产精品一区二区三区http://www.aygfsteel.com/liuzheng/category/24914.htmlzh-cnTue, 30 Oct 2007 09:31:21 GMTTue, 30 Oct 2007 09:31:21 GMT60XML DOM object鐨勯氱敤鍒涘緩鏂規(guī)硶http://www.aygfsteel.com/liuzheng/articles/156657.html鍒橀摦 鍒橀摦 Mon, 29 Oct 2007 05:27:00 GMThttp://www.aygfsteel.com/liuzheng/articles/156657.htmlhttp://www.aygfsteel.com/liuzheng/comments/156657.htmlhttp://www.aygfsteel.com/liuzheng/articles/156657.html#Feedback0http://www.aygfsteel.com/liuzheng/comments/commentRss/156657.htmlhttp://www.aygfsteel.com/liuzheng/services/trackbacks/156657.html var aVersions = [ "MSXML2.DOMDocument.5.0",
"MSXML2.DOMDocument.4.0"," MSXML2.DOMDocument.3.0",
"MSXML2.DOMDocument"," Microsoft.XmlDom"
];
for (var i = 0; i < aVersions.length; i++) {
try {
var oXmlDom = new ActiveXObject(aVersions[i]);
return oXmlDom;
} catch (oError) {
//Do nothing
}
}
throw new Error("MSXML is not installed.");
}


浣跨敤濡備笅錛?br /> var oXmlDom = createDocument();

]]>
鍒涘緩XMLlHttp鐨勯氱敤鏂規(guī)硶http://www.aygfsteel.com/liuzheng/articles/156624.html鍒橀摦 鍒橀摦 Mon, 29 Oct 2007 03:36:00 GMThttp://www.aygfsteel.com/liuzheng/articles/156624.htmlhttp://www.aygfsteel.com/liuzheng/comments/156624.htmlhttp://www.aygfsteel.com/liuzheng/articles/156624.html#Feedback0http://www.aygfsteel.com/liuzheng/comments/commentRss/156624.htmlhttp://www.aygfsteel.com/liuzheng/services/trackbacks/156624.html if (typeof XMLHttpRequest != "undefined") {
return new XMLHttpRequest();
} else if (window.ActiveXObject) {
var aVersions = [ "MSXML2.XMLHttp.5.0",
"MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
"MSXML2.XMLHttp","Microsoft.XMLHttp"
];
for (var i = 0; i < aVersions.length; i++) {
try {
var oXmlHttp = new ActiveXObject(aVersions[i]);
return oXmlHttp;
} catch (oError) {
//Do nothing
}
}
}
throw new Error("XMLHttp object could be created.");
}



浣跨敤濡備笅錛?br /> var oXmlHttp = createXMLHttp() 錛?

]]>
Advantages and Disadvantages of XMLHttphttp://www.aygfsteel.com/liuzheng/articles/156610.html鍒橀摦 鍒橀摦 Mon, 29 Oct 2007 02:50:00 GMThttp://www.aygfsteel.com/liuzheng/articles/156610.htmlhttp://www.aygfsteel.com/liuzheng/comments/156610.htmlhttp://www.aygfsteel.com/liuzheng/articles/156610.html#Feedback0http://www.aygfsteel.com/liuzheng/comments/commentRss/156610.htmlhttp://www.aygfsteel.com/liuzheng/services/trackbacks/156610.html The downside is that, unlike hidden frames, there is no browser history record of the calls that were made. The Back and Forward buttons do not tie in to XMLHttp requests, so you have effectively cut off their use. It is for this reason that many Ajax applications use a mixture of XMLHttp and hidden frames to make a truly usable interface.
Another disadvantage, which applies to Internet Explorer only, is that you depend on ActiveX controls being enabled. If the user has your page set up in a particular security zone that doesn't allow ActiveX controls, you cannot access the XMLHttp object. In that case, you may have to default to using hidden frames.

]]>
Advantages and Disadvantages of Hidden Frameshttp://www.aygfsteel.com/liuzheng/articles/156600.html鍒橀摦 鍒橀摦 Mon, 29 Oct 2007 02:23:00 GMThttp://www.aygfsteel.com/liuzheng/articles/156600.htmlhttp://www.aygfsteel.com/liuzheng/comments/156600.htmlhttp://www.aygfsteel.com/liuzheng/articles/156600.html#Feedback0http://www.aygfsteel.com/liuzheng/comments/commentRss/156600.htmlhttp://www.aygfsteel.com/liuzheng/services/trackbacks/156600.html Now that you have seen the powerful things that you can do using hidden frames, it's time to discuss the practicality of using them. As mentioned previously, this technique has been around for many years and is still used in many Ajax applications.
One of the biggest arguments for using hidden frames is that you can maintain the browser history and thus enable users to still use the Back and Forward buttons in the browser. Because the browser doesn't know that a hidden frame is, in fact, hidden, it keeps track of all the requests made through it. Whereas the main page of an Ajax application may not change, the changes in the hidden frame mean that the Back and Forward buttons will move through the history of that frame instead of the main page. This technique is used in both Gmail and Google Maps for this very reason.
The downside of hidden frames is that there is very little information about what's going on behind the scenes. You are completely reliant on the proper page being returned. The examples in this section all had the same problem: If the hidden frame page failed to load, there is no notification to the user that a problem has occurred; the main page will continue to wait until the appropriate JavaScript function is called. You may be able to provide some comfort to a user by setting a timeout for a long period of time, maybe five minutes, and displaying a message if the page hasn't loaded by then, but that's just a workaround. The main problem is that you don't have enough information about the HTTP request that is happening behind the scenes. Fortunately, there is another option.

]]>
浜岀駭鑱斿姩鑿滃崟浠g爜http://www.aygfsteel.com/liuzheng/articles/136664.html鍒橀摦 鍒橀摦 Tue, 14 Aug 2007 06:32:00 GMThttp://www.aygfsteel.com/liuzheng/articles/136664.htmlhttp://www.aygfsteel.com/liuzheng/comments/136664.htmlhttp://www.aygfsteel.com/liuzheng/articles/136664.html#Feedback0http://www.aygfsteel.com/liuzheng/comments/commentRss/136664.htmlhttp://www.aygfsteel.com/liuzheng/services/trackbacks/136664.html浜岀駭鑱斿姩鑿滃崟浠g爜(AJAX+JAVA)

鍋氶」鐩粡甯歌鐢ㄥ埌鐨?鐜板湪鍙粰鍑轟竴涓笉鐢ㄦ暟鎹簱鐨勪唬鐮?鍙綔鍙傝?
/**
*category.jsp 鍚湁AJAX紼嬪簭
*
*/
[java]
<%@ page language="java" pageEncoding="UTF-8"%>
<html>
  <head>
    <title>浜岀駭鑿滃崟鑱斿姩婕旂ず</title>
  <script type="text/javascript">
    var req;
    window.onload=function(){//欏甸潰鍔犺澆鏃剁殑鍑芥暟

    }
   
    function Change_Select(){//褰撶涓涓笅鎷夋鐨勯夐」鍙戠敓鏀瑰彉鏃惰皟鐢ㄨ鍑芥暟
      var zhi = document.getElementById('hero').value;
      var url = "servlet/select?id="+ escape(zhi);
      if(window.XMLHttpRequest){
        req = new XMLHttpRequest();
      }else if(window.ActiveXObject){
        req = new ActiveXObject("Microsoft.XMLHTTP");
      }
      
      if(req){
        req.open("GET",url,true);
        req.onreadystatechange = callback; //鎸囧畾鍥炶皟鍑芥暟涓篶allback
        req.send(null);
      }
    }
   
    function callback(){
      if(req.readyState ==4){
        if(req.status ==200){
          parseMessage();//瑙f瀽XML鏂囨。
        }else{
          alert("Not able to retrieve description" + req.statusText);
        }
      }
    }
   
    function parseMessage(){
      var xmlDoc = req.responseXML.documentElement;//鑾峰緱榪斿洖鐨刋ML鏂囨。
      var xSel = xmlDoc.getElementsByTagName('select');
      //鑾峰緱XML鏂囨。涓殑鎵鏈?lt;select>鏍囪
      var select_root = document.getElementById('skill');
      //鑾峰緱緗戦〉涓殑絎簩涓笅鎷夋
      select_root.options.length=0;
      //姣忔鑾峰緱鏂扮殑鏁版嵁鐨勬椂鍊欏厛鎶婃瘡浜屼釜涓嬫媺妗嗘灦鐨勯暱搴︽竻0
      
      for(var i=0;i<xSel.length;i++){
        var xValue = xSel[i].childNodes[0].firstChild.nodeValue;
        //鑾峰緱姣忎釜<select>鏍囪涓殑絎竴涓爣璁扮殑鍊?涔熷氨鏄?lt;value>鏍囪鐨勫?br>        var xText = xSel[i].childNodes[1].firstChild.nodeValue;
        //鑾峰緱姣忎釜<select>鏍囪涓殑絎簩涓爣璁扮殑鍊?涔熷氨鏄?lt;text>鏍囪鐨勫?br>        
        var option = new Option(xText, xValue);
        //鏍規(guī)嵁姣忕粍value鍜宼ext鏍囪鐨勫煎垱寤轟竴涓猳ption瀵硅薄
        
        try{
          select_root.add(option);//灝唎ption瀵硅薄娣誨姞鍒扮浜屼釜涓嬫媺妗嗕腑
        }catch(e){
        }
      }
    }        
  </script>
  </head>

  <body>
  <div align="center">
  <form name="form1" method="post" action="">
  <table width="70%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center">Double Select Box</td>
    </tr>
    <tr>
    <td>
    <select name="hero" id="hero" onChange="Change_Select()">
    <!--絎竴涓笅鎷夎彍鍗?->
      <option value="0">Unbounded</option>
      <option value="1">D.K. </option>
      <option value="2">NEC. </option>
      <option value="3">BOSS </option>
    </select>
    <select name="skill" id="skill">
    <!--絎簩涓笅鎷夎彍鍗?->
      <option value="0">Unbounded</option>
    </select>
    </td>
    </tr>
    <tr>
    <td> </td>
    <tr>
    </table>
  </form>
  </div>
  </body>
</html>
[/java]
2007-3-27 15:00 bufegar
/**
*SelectServelet.java 澶勭悊欏甸潰榪斿洖鐨勬暟鎹?榪斿洖XML緇橝JAX浣跨敤
*
*/

[java]
package onlinetest.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class SelectServlet extends HttpServlet {

  /**
   * The doGet method of the servlet. <br>
   *
   * This method is called when a form has its tag value method equals to get.
   *
   * @param request
   *            the request send by the client to the server
   * @param response
   *            the response send by the server to the client
   * @throws ServletException
   *             if an error occurred
   * @throws IOException
   *             if an error occurred
   */
  public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    response.setContentType("text/xml");
    response.setHeader("Cache-Control", "no-cache");
    String targetId = request.getParameter("id").toString();
    // 鑾峰緱璇鋒眰涓弬鏁頒負id鐨勫?br>    String xml_start = "<selects>";
    String xml_end = "</selects>";
    String xml = "";

    if (targetId.equalsIgnoreCase("0")) {
      xml = "<select><value>0</value><text>Unbounded</text></select>";
    } else if (targetId.equalsIgnoreCase("1")) {
      xml = "<select><value>1</value><text>Mana Burn</text></select>";
      xml += "<select><value>2</value><text>Death Coil</text></select>";
      xml += "<select><value>3</value><text>Unhkly Aura</text></select>";
      xml += "<select><value>4</value><text>Unholy Fire</text></select>";
    } else if (targetId.equalsIgnoreCase("2")) {
      xml = "<select><value>1</value><text>Corpexplode</text></select>";
      xml += "<select><value>2</value><text>Raise Dead</text></select>";
      xml += "<select><value>3</value><text>Brilliance Aura</text></select>";
      xml += "<select><value>4</value><text>Aim Aura</text></select>";
    } else {// 濡傛灉鏄?,鍒欒繑鍥炰笅闈㈢殑瀛楃
      xml = "<select><value>1</value><text>Rain of Chaos</text></select>";
      xml += "<select><value>2</value><text>Finger of Death</text></select>";
      xml += "<select><value>3</value><text>Bash</text></select>";
      xml += "<select><value>4</value><text>Summon Doom</text></select>";
    }

    String last_xml = xml_start + xml + xml_end;
    response.getWriter().write(last_xml);

  }

  /**
   * The doPost method of the servlet. <br>
   *
   * This method is called when a form has its tag value method equals to
   * post.
   *
   * @param request
   *            the request send by the client to the server
   * @param response
   *            the response send by the server to the client
   * @throws ServletException
   *             if an error occurred
   * @throws IOException
   *             if an error occurred
   */
  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

    doGet(request, response);// 瀵逛簬post鐨勮姹傛柟寮忓拰get璇鋒眰鏂瑰紡涓鏍峰鐞?br>  }

}
[/java]

2007-3-27 15:02 bufegar
/**
*web.xml 閰嶇疆Servlet,鍙互浣跨敤MyEclipse鍒涘緩Servlet,鑷姩鐢熸垚web.xml
*
*/

[xml]
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="<a target="_blank">[url]http://java.sun.com/xml/ns/j2ee[/url]"</a> xmlns:xsi="<a target="_blank">[url]http://www.w3.org/2001/XMLSchema-instance[/url]"</a> version="2.4" xsi:schemaLocation="<a target="_blank">[url]http://java.sun.com/xml/ns/j2ee[/url]</a>   <a target="_blank">[url]http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd[/url]"></a>
  <servlet>
    <servlet-name>select</servlet-name>
    <servlet-class>onlinetest.servlet.SelectServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>select</servlet-name>
    <url-pattern>/servlet/select</url-pattern>
  </servlet-mapping>
  
  <filter>
        <filter-name>characterFilter</filter-name>
        <filter-class>filters.SetCharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
   <filter-mapping>
    <filter-name>characterFilter</filter-name>
    <url-pattern>/*</url-pattern>
   </filter-mapping>
</web-app>[/xml]

鍘熸枃鍦板潃:[url]http://my.boolean.cn/read.php?130&part=3[/url]


]]>
主站蜘蛛池模板: 泾川县| 丰城市| 镇坪县| 海兴县| 米易县| 昌黎县| 年辖:市辖区| 万山特区| 浮山县| 巴里| 施秉县| 城市| 涿州市| 凌海市| 江阴市| 康保县| 吉木乃县| 伊宁县| 舟曲县| 丰都县| 建宁县| 通河县| 萨嘎县| 连平县| 铁力市| 贵州省| 开平市| 井陉县| 罗山县| 扎鲁特旗| 凭祥市| 忻州市| 周宁县| 日喀则市| 法库县| 禹城市| 高唐县| 乌兰察布市| 潜江市| 容城县| 陆丰市|