1. <script>
    2. var url = "http://192.168.4.18:3000/search"
    3. $.ajax({
    4. url,
    5. type:"get", //type 和method 一样的含义 只是method是version1.9添加的,所以版本1.9之前的使用type 之后的使用method
    6. dataType: 'json',//若出现跨域请求请使用'jsonp'
    7. data:{
    8. keywords:"你" //这一段相当于在url后面加上"?keywords=你" 这个问好后面的参数叫做get传值
    9. },
    10. success:res=>{
    11. console.log(res);
    12. }
    13. })
    14. </script>

    post请求.then内的代码不执行