ajax就是一个promie

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Document</title>
  8. <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
  9. </head>
  10. <body>
  11. <script>
  12. var url ="https://music.aityp.com/top/playlist?tag=华语"
  13. /* ajax就是一个promie */
  14. var ajax = $.ajax({url,type:"get"})
  15. console.log(ajax)
  16. ajax.then(res=>{
  17. console.log(res)
  18. })
  19. </script>
  20. </body>
  21. </html>

image.png