2013-03-27 76 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');