我有這個ajax代碼,其中顯示更多的細節1 Div ..我的問題是如何在兩個或三個div顯示ajax?Ajax多個div
function GetDetails(id)
{
$(document).ready(one);
function one()
{
if(window.XMLHttpRequest){
xmlhttp = new XMLHttpRequest();
}else {
xmlhttp = new ActiveXObject('Micrososft.XMLHTTP');
}
xmlhttp.onreadystatechange = function() {
if(xmlhttp.readyState ==4 && xmlhttp.status == 200) {
document.getElementById('tv'+id).innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open('GET', 'ajax.php?c='+id, true);
xmlhttp.send();
var thebutton = '#button'+id;
$(thebutton).hide();
}
}
你是什麼意思?你想打破更多div的結果還是你想獲得更多的div值? – axiomer 2012-02-05 09:34:55
如果您使用的是jQuery,那麼您爲什麼不使用['。.load()'](http://api.jquery.com/load/)? – DaveRandom 2012-02-05 09:37:51
我有兩種數據我想在不同的div中顯示它們,而不是一個。 – 2012-02-05 09:39:16