+ -
当前位置:首页 → 问答吧 → 如何得到jquery load后的html

如何得到jquery load后的html

时间:2011-11-28

来源:互联网

JScript code

$("#myID").load("test.php");



我想直接得到,而不是用myID获取的。类似于这样的:var html = $.load("test.php"); 但这样不行。

作者: dgtoday   发布时间: 2011-11-28

$(function()
{
$.ajax({
url: "test.php",
dataType: "html",
type: "GET",
cache: false,
success: function(html)
{
var html = html;
}
});
});

作者: andyxl   发布时间: 2011-11-28

$.get(
 "test.php", //被请求页
 { 
  name: "John", //参数名:参数值
  time: "2pm" //同上
 },
  function(data){ //请求成功
  alert("Data Loaded: " + data);
  });

作者: spc189168   发布时间: 2011-11-28

相关阅读 更多

热门下载

更多