日期:2014-05-16  浏览次数:20385 次

jquery 指定DIV中加载另一张页面 【在线等,急】

需要载入的页面:http://localhost/news/?ct=question&ac=reply&id=60

当前页:<div id="news"></div>

JQ:
$("#news").click(function(){
    //载入指定页面到DIV中
});


各位,没积分了!救助 



jQuery

------解决方案--------------------
$('#news').load('http://localhost/news/?ct=question&ac=reply&id=60');
------解决方案--------------------
你下载一个API好好看看,看不懂再问。
------解决方案--------------------
引用:
$('#news').load('http://localhost/news/?ct=question&ac=reply&id=60');

可以上网查查jquery的load方法
------解决方案--------------------
新建一个ifrom插入也行
------解决方案--------------------
var str='<iframe src="http://localhost/news/?ct=question&ac=reply&id=60" id="linkframe" name="linkframe" width="100%" frameborder="0" scrolling="no" ></iframe>'
$("#news").append(str);

------解决方案--------------------
可以用jqury ajax的load方法啊 $(".class").load("test.html .class"),  第一哥参数就是获取test页面,第二个是可选的,就是可以只获取test页面中指定class内容。
------解决方案--------------------
$('#news').load('http://localhost/news/?ct=question&ac=reply&id=60');