1
改變以.html一個div的內容這樣做之後:後
$.ajax({
type: "POST",
url: $("#form").attr("action"),
data: "value=" + value + "&sel=" + sel,
success: function(data) {
$("#cont-pag").html(data);
}
/*success: function(msg) {
alert(msg);
}*/
});
我得到的代碼一大塊(我與警報檢查味精)內的。我的原始頁面已經有了一個大的div,我只想從ajax調用中取代之前的那個。我做錯了嗎?
編輯:這是應該出現的結構是這樣的: 我有我查詢過這裏的東西,然後......
echo'<div id="cont_pag">
<ul id="content_pag">';
while($row = mysql_fetch_object($res)){
echo'<li>...</li>';
}
echo'</ul>'; //here is when my msg will stop painting code, but there's more:
if (mysql_num_rows($res)>8)
echo '<div id="page_navigation"></div><div class="siguiente-pag"><p>'.$cajon_siguiente.'</p></div>
</div>'; ?>
好了,所以我回答說過去的事情我自己。我錯過了我的標記一如既往:
echo '<div id="page_navigation"></div><div class="siguiente-pag"><p>'.$cajon_siguiente.'</p></div>';
echo'</div>'; ?>
現在警報顯示正確,但生成.html不會取代原來的股利。我可能在某處有衝突的腳本嗎? (這是一個複雜的項目,很多人都在這個項目上工作,並且有幾處jquery的調整)。我可以做不同的div替換嗎?
語法是正確的..但數據可能有一些問題..數據實際上是什麼樣子? – ppumkin 2011-05-17 10:20:37
其實,我剛剛檢查過(因爲它是一個巨大的股利,我第一次錯過了),我錯過了收盤股。它在代碼中,但我不知道它是如何迷路的。我不能在這裏鏈接代碼,我會編輯我的帖子。 – 2011-05-17 10:28:27