jquery ajax请求

cooolr 于 2020-11-25 发布
<script src="[http://libs.baidu.com/jquery/2.0.0/jquery.js](http://libs.baidu.com/jquery/2.0.0/jquery.js)"></script>

<!-- get请求 -->
<script>
$(document).ready({
    $.get("[http://127.0.0.1:5001/news](http://127.0.0.1:5001/news)",function(data, status){
        alert(data);
    })
})
</script>

<!-- post请求 -->
<script>
$(document).ready({
    $.post("[http://127.0.0.1:5001/news](http://127.0.0.1:5001/news)",{value: "hello"},function(data, status){
        alert(data);
    })
})
</script>