我有这个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