jQuery操作基本操作三学习笔记 ajax二

$.get(url, [data], [callback], [type]) 通过远程 HTTP GET 请求载入信息;这是$.ajax的一个高级实现。
    参数  描述

url 发送请求的地址

data 待发送 Key/value 参数

type 返回内容格式,xml, html, script, json, text, _default

callback 请求成功后的回调函数。参数:由服务器返回,并根据type参数进行处理后的数据

示例:
$.get("testServlet", { name: "John", time: "2pm" },
  function(data){
    alert("Data Loaded: " + data);
  });

猜你喜欢

转载自blog.51cto.com/357712148/2134699