1.XMLHttpRequest 对象:向服务器发送局部的请求,异步获取执行

  a.浏览器支持

  b.语法:

    xmlhttp==new XMLHttpRequest();

    xmlhttp.open("GET","test1.txt",true);# open(method,url,async

    xmlhttp.send();

    #异步执行,当服务器完成状态了,在客户端调用该函数

    xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("myDiv").innerHTML=xmlhttp.responseText; } }


2.django中ajax:
  在views中使用request.is_ajax()判断是否为ajax请求

相关文章:

  • 2021-04-10
  • 2022-12-23
  • 2021-11-17
  • 2021-07-21
  • 2021-06-13
  • 2022-12-23
  • 2021-10-06
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2021-04-23
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2021-05-15
相关资源
相似解决方案