如何學(xué)好java

          如何學(xué)好java,其實很簡單,只要用心體會,慢慢積累!
          posts - 106, comments - 7, trackbacks - 0, articles - 3
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
          http://www.wujianrong.com/archives/2007/05/20jspajax.html      簡單用例
          http://www.ibm.com/developerworks/cn/web/wa-ajaxintro/          IBM—Ajax講解
          http://www.w3schools.com/ajax/ajax_example.asp                     Ajax—Example  W3CSchol



          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          ">

          <html>
          <head>
          <script src="ajax.js"></script>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
          <title>JSP Page using AJAX</title>
          </head>
          <body>

          <a onclick="sendRequest('GET','index.jsp')" href="#">Server Date Time:</a>
          <div id="ajax_res">Server Date Time will replace this text.</div>
          </body>
          </html>

          index.jsp
          <html>
          <body>
          <%=new java.util.Date()%>
          </body>
          </html>

          ajax.js
          function createRequestObject(){
          var req;
          if(window.XMLHttpRequest){
          //For Firefox, Safari, Opera
          req = new XMLHttpRequest();
          }
          else if(window.ActiveXObject){
          //For IE 5+
          req = new ActiveXObject("Microsoft.XMLHTTP");
          }
          else{
          //Error for an old browser
          alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera');
          }

          return req;
          }

          //Make the XMLHttpRequest Object
          var http = createRequestObject();

          function sendRequest(method, url){
          if(method == 'get' || method == 'GET'){
          http.open(method,url);
          http.onreadystatechange = handleResponse;
          http.send(null);
          }
          }

          function handleResponse(){
          if(http.readyState == 4 && http.status == 200){
          var response = http.responseText;
          if(response){
          document.getElementById("ajax_res").innerHTML = response;
          }
          }
          }
          run this application may be u get some clue
          主站蜘蛛池模板: 青铜峡市| 东乌珠穆沁旗| 万山特区| 浮梁县| 娄烦县| 天峨县| 宣武区| 安丘市| 那曲县| 邯郸县| 林口县| 内黄县| 曲沃县| 图们市| 民权县| 全州县| 郸城县| 金华市| 凤台县| 清河县| 邢台县| 邻水| 五原县| 元朗区| 雷州市| 望都县| 海口市| 浮山县| 栾川县| 抚顺县| 台中市| 含山县| 汉川市| 芮城县| 兴山县| 巨野县| 郓城县| 宜昌市| 汝城县| 台江县| 崇州市|