<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../lib/jquery-3.6.0.min.js"></script>
</head>

<body>
    <button id="bt1">$.ajax请求数据</button>

    <script>
        $(function () {
            $("#bt1").on('click', () => {
                $.ajax({
                    type: 'GET',
                    url: 'http://www.liulongbin.top:3006/api/getbooks',
                    data: { id: 1 },
                    success: (res) => {
                        console.log(res)
                    }
                })
            })
        })
    </script>

</body>

</html>

 

相关文章:

  • 2022-12-23
  • 2021-08-14
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-06-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2021-08-22
  • 2021-11-19
  • 2021-07-15
相关资源
相似解决方案