{"id":151861,"date":"2020-08-29T16:48:43","date_gmt":"2020-08-29T08:48:43","guid":{"rendered":"http:\/\/4563.org\/?p=151861"},"modified":"2020-08-29T16:48:43","modified_gmt":"2020-08-29T08:48:43","slug":"chrome-%e6%b5%8f%e8%a7%88%e5%99%a8%e8%83%bd%e5%90%a6%e8%ae%a9%e6%9c%ac%e5%9c%b0%e7%9a%84-html-%e9%80%9a%e8%bf%87-ajax-%e5%8a%a0%e8%bd%bd%e6%9c%ac%e5%9c%b0%e6%96%87%e4%bb%b6%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=151861","title":{"rendered":"chrome \u6d4f\u89c8\u5668\u80fd\u5426\u8ba9\u672c\u5730\u7684 html \u901a\u8fc7 ajax \u52a0\u8f7d\u672c\u5730\u6587\u4ef6\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  chrome \u6d4f\u89c8\u5668\u80fd\u5426\u8ba9\u672c\u5730\u7684 html \u901a\u8fc7 ajax \u52a0\u8f7d\u672c\u5730\u6587\u4ef6\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cat <\/span>  <span><i><\/i> 4<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6bd4\u5982\u6709\u4e00\u4e2a <code>index.html<\/code> \u6587\u4ef6\uff0c\u5176\u4e2d\u6709\u4e00\u6bb5\u4ee3\u7801\u662f <code>fetch('data.json')<\/code> \u52a0\u8f7d\u540c\u76ee\u5f55\u7684 <code>data.json<\/code> \u6587\u4ef6\uff1b<\/p>\n<p>chrome \u76f4\u63a5\u6253\u5f00\u8fd9\u4e2a <code>index.html<\/code> \uff08\u4e0d\u4f7f\u7528 nginx \u6216\u5176\u5b83 http server \uff09\uff0c\u4f1a\u52a0\u8f7d\u5931\u8d25\uff1a<\/p>\n<pre><code>Fetch API cannot load file:\/\/\/ URL scheme must be \"http\" or \"https\" for CORS <\/code><\/pre>\n<p>\u6539\u6210 <code>XMLHttpRequest<\/code> \u65b9\u5f0f\u52a0\u8f7d\u4e5f\u662f\u7c7b\u4f3c\u7684\u9519\u8bef\uff1b<\/p>\n<p>\u8fd8\u6709\u4ec0\u4e48\u529e\u6cd5\u53ef\u4ee5\u52a0\u8f7d\u672c\u5730\u6587\u4ef6\u5417\uff0c\u5ba2\u6237\u4e0d\u60f3\u90e8\u7f72 http server\uff0c\u5e0c\u671b\u5728\u672c\u5730\u76f4\u63a5\u6253\u5f00\u9875\u9762\u5c55\u793a\u6570\u636e\u7ed3\u679c<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>13<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3170744\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : johnnyNg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u628a data.json \u6539\u6210 data.js \u5427\uff0c\u5f15\u5165 js \u6587\u4ef6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170745\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @johnnyNg \u8c22\u8c22\uff0c\u4f46\u9875\u9762\u4e0a\u6709\u5176\u5b83\u7c7b\u578b\u7684\u6587\u4ef6\u9700\u8981\u52a8\u6001\u52a0\u8f7d\uff0c\u5e76\u4e14\u662f\u7531\u7b2c\u4e09\u65b9\u63d2\u4ef6\u52a0\u8f7d\u7684\uff0c\u65e0\u6cd5\u8fd9\u6837\u641e\uff0c\u8fd8\u6709\u5176\u5b83\u65b9\u6cd5\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170746\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pinews <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             html \u53ef\u4ee5\u9ed8\u8ba4\u52a0\u8f7d\u56fe\u7247\u548c\u89c6\u9891\uff0c\u53ef\u4ee5\u8fd0\u884c js \u6587\u4ef6<\/p>\n<p>\u5176\u4ed6\u6587\u4ef6\u90fd\u5fc5\u987b\u7528\u6237\u4eb2\u81ea\u64cd\u4f5c\uff08\u5373\u7528\u6237\u8bb8\u53ef\uff09\u624d\u80fd\u8fd0\u884c\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170747\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : johnnyNg <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @cat Electron \u8d70\u8d77                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170748\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @johnnyNg                                                             <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170749\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @pinews \u9700\u8981\u52a0\u8f7d\u7684\u5176\u5b83\u7c7b\u578b\u6587\u4ef6 \u672c\u8d28\u4e0a\u4e5f\u662f\u4e00\u4e32\u6587\u672c\uff0c\u6211\u770b\u770b\u80fd\u4e0d\u80fd\u4e00\u8d77\u641e\u5230 js \u91cc\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170750\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Sapp <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             chrome \u8981\u662f\u7ed9\u4f60\u8fd9\u4e2a\u6743\u9650\u600e\u4e48\u4fdd\u8bc1\u5b89\u5168\uff1f \u8fd9\u660e\u663e\u662f\u4e0d\u53ef\u80fd\u7ed9\u4f60\u7684\u6743\u9650\u554a\uff0c\u4e0d\u7136\u4f60\u778e\u8bfb\u5ba2\u6237\u6587\u4ef6\u4e0a\u4f20\u3002<br \/>\u8981\u4e48\u4f60\u8ba9\u7528\u6237\u81ea\u5df1\u9009\u62e9\u6587\u4ef6\u52a0\u8f7d\uff0c\u7136\u540e\u4f60\u8bfb\u53d6\u4ed6\u9009\u62e9\u7684\u6587\u4ef6\uff0c\u8981\u4e48 electron\uff0c\u4ec0\u4e48\u6743\u9650\u90fd\u80fd\u81ea\u5df1\u641e\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170751\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @Sapp \u4ee5 file:\/\/ \u534f\u8bae\u6253\u5f00\u7684\u672c\u5730\u6587\u4ef6\uff0c\u548c\u4e92\u8054\u7f51\u4e0a\u7684\u7f51\u9875\u4e0d\u80fd\u76f8\u63d0\u5e76\u8bba\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170752\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : pinews <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @cat \u522b\u60f3\u4e86\uff0c\u9053\u7406\u662f\u4e00\u6837\u7684\uff0c\u90fd\u9700\u8981\u8bb8\u53ef\uff0c\u672c\u5730 js \u6587\u4ef6\u4e4b\u6240\u4ee5\u80fd\u8fd0\u884c\uff0c\u662f\u8fd9\u4e2a\u884c\u4e3a\u5f97\u5230\u4e86\u7528\u6237\u903b\u8f91\u4e0a\u7684\u8bb8\u53ef\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170753\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : phy25 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             https:\/\/bugs.chromium.org\/p\/chromium\/issues\/detail?id=47416                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170754\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : isDebug <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u8fd9\u662f mock \u5417 \u76f4\u63a5\u7528 js import \u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170755\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : imn1 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u672c\u5730\u7684\u8bdd\u4e5f\u6ca1\u5fc5\u8981 ajax\uff0c\u5199\u5165 html \u6587\u4ef6\u91cc\u9762\u5c31\u884c\u4e86<br \/>\u6216\u8005\u81ea\u5df1\u5199\u4e2a\u7a0b\u5e8f\uff0c\u5185\u7f6e webkit\uff0c\u5982 pyqt \u505a\u8fd9\u4e2a\u5c31\u51e0\u884c\u4ee3\u7801\u800c\u5df2                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3170756\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : miaowm5 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u5ba2\u6237\u4e0d\u60f3\u90e8\u7f72 http server \u53ea\u662f\u56e0\u4e3a\u5acc\u9ebb\u70e6\uff0c\u90a3\u76f4\u63a5\u5199\u4e00\u4e2a\u5355\u6587\u4ef6\u65e0\u914d\u7f6e\u7684\u9759\u6001\u6587\u4ef6\u670d\u52a1\u5668\u5462\uff1f<\/p>\n<p>\u6bd4\u5982\u6211\u81ea\u5df1\u662f\u5077\u5077\u5f80\u76ee\u5f55\u91cc\u6254\u4e86\u4e2a node.exe \uff0c\u7136\u540e\u8bf4\u4e0d\u9700\u8981\u90e8\u7f72\u53ea\u9700\u8981\u8fd0\u884c\u4e00\u4e2a bat \u5c31\u884c\uff0c\u90a3\u4e2a bat \u91cc\u5b9e\u9645\u4e0a\u662f\u8c03\u7528 node.exe \u5728\u5f53\u524d\u76ee\u5f55\u8d77\u4e86\u4e2a\u9759\u6001\u670d\u52a1\u5668\u7136\u540e\u6253\u5f00\u4e86 chrome\u2026\u2026                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>chrome \u6d4f\u89c8\u5668\u80fd\u5426\u8ba9\u672c\u5730\u7684 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/151861"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=151861"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/151861\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=151861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=151861"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=151861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}