{"id":481,"date":"2009-06-22T23:51:00","date_gmt":"2009-06-22T03:51:00","guid":{"rendered":""},"modified":"2013-11-19T21:19:28","modified_gmt":"2013-11-19T13:19:28","slug":"ajax%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0-%e5%be%85%e7%bb%ad","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/481.html","title":{"rendered":"AJAX\u5b66\u4e60\u7b14\u8bb0"},"content":{"rendered":"<p>\u653e\u653eDelphi\uff0c\u7ee7\u7eed\u6211\u7684WEB\u7f16\u7a0b<\/p>\n<p>\u521b\u5efaXMLHttpRequest\u5bf9\u8c61\u7684\u4e00\u4e2a\u5b9e\u4f8b<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\nfunction createXmlHttpRequestObject()\r\n{\r\n  var xmlHttp;\r\n  if(window.ActiveXObject)\r\n  {\r\n    try\r\n    {\r\n      xmlHttp = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);\r\n    }\r\n    catch (e)\r\n    {\r\n      xmlHttp = false;\r\n    }\r\n  }\r\n  else\r\n  {\r\n    try\r\n    {\r\n      xmlHttp = new XMLHttpRequest();\r\n    }\r\n    catch (e)\r\n    {\r\n      xmlHttp = false;\r\n    }\r\n  }\r\n  if (!xmlHttp)\r\n    alert(&quot;Error creating the XMLHttpRequest object.&quot;);\r\n  else\r\n    return xmlHttp;\r\n}\r\n<\/pre>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n $.ajax({\r\n\r\n type:&quot;post&quot;,\r\n\r\n url:&quot;stu_newpassPost.aspx&quot;,\r\n\r\n data:&quot;pass=&quot;+document.form1.pass.value+&quot;&amp;t=&quot;+Math.random(),\r\n\r\n success:function(html){alert(html);}\r\n\r\n });\r\n<\/pre>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n$.get(&quot;stu_delWork.aspx&quot;,{&quot;user&quot;:&quot;student&quot;,&quot;delid&quot;:id,&quot;t&quot;:Math.random()},function(data){alert(data);}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u653e\u653eDelphi\uff0c\u7ee7\u7eed\u6211\u7684WEB\u7f16\u7a0b \u521b\u5efaXMLHttpRequest\u5bf9\u8c61\u7684\u4e00\u4e2a\u5b9e\u4f8b function cre [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-481","post","type-post","status-publish","format-standard","hentry","category-my_notes"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":3,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":4836,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/481\/revisions\/4836"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}