{"id":684,"date":"2009-04-27T15:04:52","date_gmt":"2009-04-27T07:04:52","guid":{"rendered":"http:\/\/fdream.net\/blog\/article\/684.aspx"},"modified":"2009-04-27T15:04:26","modified_gmt":"2009-04-27T07:04:26","slug":"%e5%88%a9%e7%94%a8GAE%26Google+Gears%e5%81%9a%e4%ba%86%e4%b8%80%e4%b8%aa%e7%ae%80%e5%8d%95%e7%9a%84AJAX%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/fdream.net\/blog\/article\/684","title":{"rendered":"\u5229\u7528GAE&#038;Google Gears\u505a\u4e86\u4e00\u4e2a\u7b80\u5355\u7684AJAX\u4ee3\u7406"},"content":{"rendered":"<p>\u505a\u8fd9\u4e2a\u7684\u8d77\u56e0\u5f88\u7b80\u5355\uff1a\u6211\u559c\u6b22\u7528<a href=\"http:\/\/www.google.com\/chrome\" target=\"_blank\" title=\"Google Chrome\">Google Chrome<\/a>\uff0c\u53c8\u559c\u6b22\u901b<a href=\"http:\/\/www.douban.com\" target=\"_blank\" title=\"\u8c46\u74e3\">\u8c46\u74e3<\/a>\uff0c<a href=\"http:\/\/www.google.com\/chrome\" target=\"_blank\" title=\"Google Chrome\">Google Chrome<\/a>\u652f\u6301<a href=\"http:\/\/userscripts.org\/\" target=\"_blank\" title=\"User Scripts\">User Scripts<\/a>\u4e86\uff0c\u4f46\u662f\u6211\u5199\u7684\u90a3\u51e0\u4e2a\u63d2\u4ef6\u5728Chrome\u4e0b\u53c8\u8dd1\u4e0d\u4e86\u3002\u56e0\u4e3a<a href=\"http:\/\/www.google.com\/chrome\" target=\"_blank\" title=\"Google Chrome\">Google Chrome<\/a>\u6709<a href=\"http:\/\/code.google.com\/apis\/gears\/\" target=\"_blank\" title=\"Google Gears\">Google Gears<\/a>\uff0c\u636e\u8bf4\u53ef\u4ee5\u8de8\u57dfAjax\uff0c\u4e8e\u662f\u5f04\u5427\uff01\u7ed3\u679c\u8d8a\u5f04\u8d8a\u590d\u6742\uff0c\u56e0\u4e3a<a href=\"http:\/\/code.google.com\/apis\/gears\/\" target=\"_blank\" title=\"Google Gears\">Google Gears<\/a>\u7684\u8de8\u57df\u4e5f\u662f\u6709\u5f88\u591a\u9650\u5236\u7684\uff0c\u770b\u6765\u8fd8\u5f97\u670d\u52a1\u5668\u8dd1\uff0c\u8fd8\u597d\u6709Google\u7684<a href=\"http:\/\/code.google.com\/appengine\/\" target=\"_blank\" title=\"App Engine\">App Engine<\/a>\uff0c\u7ee7\u7eed\u5f04\u4e0b\u53bb\u5427\uff01<\/p>\n<p>\u5f53\u7136\u4e86\uff0c\u73b0\u5728\u8fd9\u4e2a\u4ec5\u4ec5\u53ea\u662f\u4e3aGoogle Gears\u670d\u52a1\uff0c\u5199\u7684\u5f88\u7b80\u5355\uff0c\u4e0d\u8fc7\u8fd8\u662f\u6bd4\u8f83\u201cAjax\u201d\u7684\uff0c\u770b\u770b\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<p><pre lang=\"javascript\">\n&lt;script type=&quot;text\/javascript&quot; src=&quot;gears_init.js&quot;&gt;&lt;\/script&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\n    var options = {\n        'url': 'http:\/\/1986.appspot.com\/', \/\/\u4f60\u8981\u8bf7\u6c42\u7684\u5730\u5740\n        'method': 'GET'\n    };\n    \n    var workerPool = google.gears.factory.create('beta.workerpool');\n\n    workerPool.onmessage = function(a, b, message) {\n        \/\/alert('received: ' + message.body);\n        document.write(message.body);\n    };\n\n    var childWorkerId = workerPool.createWorkerFromUrl('http:\/\/ajaxproxy.appspot.com\/gears\/gears_proxy.js');\n    workerPool.sendMessage(options, childWorkerId);\n&lt;\/script&gt;\n<\/pre>\n<\/p>\n<p>\u540e\u7eed\u7684\u8ba1\u5212\uff0c\u8d77\u7801\u4e5f\u8981\u5b9e\u73b0JSONP\u5427\uff0c\u8fd9\u4e2a\u8fd0\u7528\u5f97\u8fd8\u662f\u975e\u5e38\u5e7f\u6cdb\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u505a\u8fd9\u4e2a\u7684\u8d77\u56e0\u5f88\u7b80\u5355\uff1a\u6211\u559c\u6b22\u7528Google Chrome\uff0c\u53c8\u559c\u6b22\u901b\u8c46\u74e3\uff0cGoogle Chrome\u652f\u6301User Scripts\u4e86\uff0c\u4f46\u662f\u6211\u5199\u7684\u90a3\u51e0\u4e2a\u63d2\u4ef6\u5728Chrome\u4e0b\u53c8\u8dd1\u4e0d\u4e86\u3002\u56e0\u4e3aGoogle Chrome\u6709Google Gears\uff0c\u636e\u8bf4\u53ef\u4ee5\u8de8\u57dfAjax\uff0c\u4e8e\u662f\u5f04\u5427\uff01\u7ed3\u679c\u8d8a\u5f04\u8d8a\u590d\u6742\uff0c\u56e0\u4e3aGoogle Gears\u7684\u8de8\u57df\u4e5f\u662f\u6709\u5f88\u591a\u9650\u5236\u7684\uff0c\u770b\u6765\u8fd8\u5f97\u670d\u52a1\u5668\u8dd1\uff0c\u8fd8\u597d\u6709Google\u7684App Engine\uff0c\u7ee7\u7eed\u5f04\u4e0b\u53bb\u5427\uff01 \u5f53\u7136\u4e86\uff0c\u73b0\u5728\u8fd9\u4e2a\u4ec5\u4ec5\u53ea\u662f\u4e3aGoogle Gears\u670d\u52a1\uff0c\u5199\u7684\u5f88\u7b80\u5355\uff0c\u4e0d\u8fc7\u8fd8\u662f\u6bd4\u8f83\u201cAjax\u201d\u7684\uff0c\u770b\u770b\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff1a &lt;script type=&quot;text\/javascript&quot; src=&quot;gears_init.js&quot;&gt;&lt;\/script&gt; &lt;script type=&quot;text\/javascript&quot;&gt; var options = { &#8216;url&#8217;: &#8216;http:\/\/1986.appspot.com\/&#8217;, \/\/\u4f60\u8981\u8bf7\u6c42\u7684\u5730\u5740 &#8216;method&#8217;: &#8216;GET&#8217; }; var workerPool = google.gears.factory.create(&#8216;beta.workerpool&#8217;); workerPool.onmessage = function(a, b, message) { \/\/alert(&#8216;received: &#8216; + message.body); document.write(message.body); }; var childWorkerId = workerPool.createWorkerFromUrl(&#8216;http:\/\/ajaxproxy.appspot.com\/gears\/gears_proxy.js&#8217;); workerPool.sendMessage(options, childWorkerId); &lt;\/script&gt; \u540e\u7eed\u7684\u8ba1\u5212\uff0c\u8d77\u7801\u4e5f\u8981\u5b9e\u73b0JSONP\u5427\uff0c\u8fd9\u4e2a\u8fd0\u7528\u5f97\u8fd8\u662f\u975e\u5e38\u5e7f\u6cdb\u7684\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[120,352],"class_list":["post-684","post","type-post","status-publish","format-standard","hentry","category-coding","tag-AJAX","tag-google"],"views":5892,"_links":{"self":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/684","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/comments?post=684"}],"version-history":[{"count":0,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/posts\/684\/revisions"}],"wp:attachment":[{"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/media?parent=684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/categories?post=684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fdream.net\/blog\/wp-json\/wp\/v2\/tags?post=684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}