2013-03-27 118 views
-1

我有以下DIV:如何刷新一个div

<div id=conteudo></div>

var div= document.getElementById("conteudo"); 
div.setAttribute("height","55"); 

我想刷新DIV,有没有办法做到这一点使用jQuery?

+5

define refresh? – Tim 2013-03-27 17:55:35

+0

这可能有所帮助:http://stackoverflow.com/questions/3261308/jquery-load-method-reload-a-specific-part-of-a-page-without-url – tymeJV 2013-03-27 17:57:12

回答

0

是否要刷新来自服务器的div中的内容?如果是这样,你可以使用jQuery中的$ .load。

http://api.jquery.com/load/

“加载页面片段” 部分更具体...

1
<div id="conteudo"></div> 

$(document).ready(function(){ 
$('#conteudo').css("height", "55px"); 
}); 
0

我使用jQuery和这为我工作。(重新加载表)

$('table#table_id').load(window.location.href + ' table#table_id');