• jQuery AJAX


    1.***.fuction(response,status,xhr);//回调函数

    xhr 中其实已经有了前面两个参数,只是因为两个比较重要,所以单独拎出来。

     xhr中包含的有:responseText,作为响应主体被返回的文本

                         responseXML,如果响应主体内容类型是"text/xml"或"application/xml",则返回包含响应数据的XML DOM文档

                         status,响应的HTTP状态

                         statusText HTTP状态的说明

    2..load()是局部方法 需要有的调   用于静态文件调用

    3.①$('input').click(function(){

          $.get(‘test.php?url=ycku',function(response,status,xhr){

             $('#box’).html(response);

          });

        });

    ②$('input').click(function(){

          $.get(‘test.php','url=ycku',function(response,status,xhr){

             $('#box’).html(response);

          });

        });

    ③$('input').click(function(){

          $.get(‘test.php',{url:‘ycku’},function(response,status,xhr){

             $('#box’).html(response);

          });

        });

    4.②$('input').click(function(){

          $.post(‘test.php','url=ycku',function(response,status,xhr){

             $('#box’).html(response);

          });

        });

     ③$('input').click(function(){

          $.post(‘test.php',{url:‘ycku’},function(response,status,xhr){

             $('#box’).html(response);

          });

        });

    5.//如果是纯文本(text/html),如果$.get,$.post的第四个参数设置成xml或者是json数据格式返回的话,就无法获取数据。(转换时用)

  • 相关阅读:
    Java重温学习笔记,Java8新特性:函数式接口
    Java重温学习笔记,Java8新特性:Lambda 表达式
    236. 二叉树的最近公共祖先
    230. 二叉搜索树中第K小的元素
    117. 填充每个节点的下一个右侧节点指针 II
    116. 填充每个节点的下一个右侧节点指针
    111. 二叉树的最小深度
    109. 有序链表转换二叉搜索树
    剑指 Offer 68
    1367. 二叉树中的列表
  • 原文地址:https://www.cnblogs.com/ejllen/p/3716572.html
Copyright © 2020-2023  润新知