zoukankan      html  css  js  c++  java
  • ajax 代码

    function ajax(){

      var aj=null;

      if(window.ActiveXObject){

        aj = new ActiveXObject("Microsoft.XMLHTTP");

      }else if(window.XMLHttpRequest){

        aj = new XMLHttpRequest();

      }

      aj.onreadystatechange = function(){

        if(aj.readyState==4){

          if(aj.status==200){

            console.log(aj.responseText)

          }

        }

      }

    //get 方式提交;

        aj.open("get",/文件路径);

        aj.send();

    //post 方式提交

        aj.open("post","/文件路径");

        var 变量= “name=”+value,"&psd="+value

        aj.setRequestHeader("Content-type","application/x-www-from-urlencoded");

        aj.send(变量);

    }

  • 相关阅读:
    iou与giou对比
    Linux学习第一天 vim
    奖励加分申请
    人月神话阅读笔记3
    5.27
    5.26
    5.25
    5.23
    5.22
    5.21
  • 原文地址:https://www.cnblogs.com/chenxilin/p/4052595.html
Copyright © 2011-2022 走看看