瀏覽代碼

HW <17>comtinued

GennadySht 2 年之前
父節點
當前提交
0a497234c5
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      js/17_async/hw_17_01_luke.html

+ 6 - 1
js/17_async/hw_17_01_luke.html

@@ -56,6 +56,11 @@
             });
             return result;
         }
-        let res = improovedFetch('https://swapi.dev/api/people/1/');
+        improovedFetch('https://swapi.dev/api/people/1/').then(
+            res => res
+        )
+        .then(
+            res => document.write(JSON.stringify(res))
+        );
     </script>
 </body>