如何學好java

          如何學好java,其實很簡單,只要用心體會,慢慢積累!
          posts - 106, comments - 7, trackbacks - 0, articles - 3
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          ajax學習相關的好網址

          Posted on 2012-02-24 23:30 哈希 閱讀(186) 評論(0)  編輯  收藏 所屬分類: Js and Jquery 常用總結
          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
          主站蜘蛛池模板: 白城市| 江安县| 青浦区| 武鸣县| 望奎县| 阿巴嘎旗| 化隆| 凌云县| 庄河市| 常德市| 凤翔县| 额尔古纳市| 翁牛特旗| 忻城县| 张家川| 吉林省| 峡江县| 鲁甸县| 威信县| 隆回县| 金堂县| 惠东县| 长岛县| 长乐市| 铜山县| 灵寿县| 凤庆县| 辉县市| 观塘区| 平塘县| 仁寿县| 运城市| 嘉祥县| 丰镇市| 梁平县| 镶黄旗| 黑河市| 永丰县| 连州市| 玉龙| 木兰县|