zoukankan      html  css  js  c++  java
  • jquery发送请求

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>cxy(runoob.com)</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
    <script>
    $(document).ready(function(){
        $("button").click(function(){
            $.get("/try/ajax/demo_test.php",function(data,status){
                alert("数据: " + data + "
    状态: " + status);
            });
        });
    });
    </script>
    </head>
    <body>
    
    <button>发送一个 HTTP GET 请求并获取返回结果</button>
    
    </body>
    </html>

    以上是get请求

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
    <script>
    $(document).ready(function(){
        $("button").click(function(){
            $.post("/try/ajax/demo_test_post.php",{
                name:"菜鸟教程",
                url:"http://www.runoob.com"
            },
            function(data,status){
                alert("数据: 
    " + data + "
    状态: " + status);
            });
        });
    });
    </script>
    </head>
    <body>
    
    <button>发送一个 HTTP POST 请求页面并获取返回内容</button>
    
    </body>
    </html>

    以上是post请求

  • 相关阅读:
    Java三年经验
    系统集成项目管理 - 笔记
    ZK
    older versions of the JRE and JDK
    [提高组集训2021] 古老的序列问题
    CF1556G Gates to Another World
    Codeforces Round #743 (Div. 1)
    [提高组集训2021] 蚂蚁
    [LOJ 6669] Nauuo and Binary Tree
    [ABC219H] Candles
  • 原文地址:https://www.cnblogs.com/xiufengchen/p/10399704.html
Copyright © 2011-2022 走看看