jQuery的$.load使用
作者:zccst
基本用法(来自手册)
//用法一
$("#feeds").load("feeds.html");
//用法二
$("#feeds").load("feeds.php", {limit: 25}, function(){
alert("The last 25 entries in the feed have been loaded");
});使用场景一:在A文件通过dialog嵌入B文件
第一步:在A文件
var url = "path/to/name.php?id=2345";
var div = $(".device_dialog").length == 0 ? $("<div class='device_dialog'></div>").appendTo("div.create"):$(".device_dialog");
div.load(url).dialog({
})第二步:在B文件,即name.php
接收A文件传递过来的参数,
echo $_GET['id'];
使用场景二:在YII中使用
1,前端
var div = $(".haha");
$("body").showLoading();
div.load("?module/controllerID/actionID",{key:value},function(r){
$("body").hideLoading();
$(this).dialog({});
},'json');2,后端
public function actionUserDoing() {
$uid = $this->request->getParam("user_id");
$this->render('user_doing', array('uid ' => $uid ));
} 相关推荐
apowerfulman 2020-03-03
hustlei 2011-03-03
Mexican 2011-08-31
larrywangsun 2011-08-09
TTHHVV 2011-09-28
87384559 2014-11-11
xuewenke 2015-11-04
火星的你 2015-10-25
王磊的程序员之路 2019-06-19
十一郎的IT 2013-10-29
攻城师 2019-06-28
89453862 2016-05-13
SinhaengHhjian 2015-11-04
sunnylinner 2014-11-11