zoukankan      html  css  js  c++  java
  • jquery笔记

        /*
    $.ajax({
                url: "Blog/Test/" + Math.random(), //要访问的后台地址
                data: "", //要发送的数据
                type: 'GET', // 设置请求类型为 ‘POST’,默认为 ‘GET’
                beforeSend: function() {
                    $('#load').show();
                },
                error: function(request) {
                    $('load').hide();
                    $('#error').show().html(request.responseText);
                },
                success: function(data) {
        $("#password").text(data.Password);
                }
            });
      */

            //$.getJSON("/Blog/Test/"+Math.random(), {}, function(data) { $("#password").html(data.Password) });
            $.ajax({
                type: "get", //使用get方法访问后台
                dataType: "json", //返回json格式的数据
                url: "http://localhost:6923/blog/Test/" + Math.random(), //要访问的后台地址
                data: "", //要发送的数据
                complete: function() { $("#load").hide(); }, //AJAX请求完成时隐藏loading提示
                success: function(data) {//msg为返回的数据,在这里做数据绑定
                    $("#password").text(data.Password);
                }
            }
                    );

  • 相关阅读:
    frp穿透.md
    6_模板与渲染.md
    4_多数据格式返回请求结果.md
    3_请求参数绑定与多数据格式处理.md
    5_中间件.md
    1_go_gin介绍.md
    2_Gin网络请求与路由处理.md
    14_文件.md
    firefox油猴脚本编写.md
    js 四舍五入
  • 原文地址:https://www.cnblogs.com/lexus/p/1307110.html
Copyright © 2011-2022 走看看