我有以下 div:
echo '<div class="product_a" href="#" onclick="loadXMLDocprod("'.$data['num_prod'].'")">
<div clas="list_products"><table><tr><td style="max-width:380px; min-width:380px; text-align:left;"><strong>'.$data['designation'].'</strong></td>
<td><div class="status"><div class="mini-counts">Price : '.$data['prix_vente'].'$</div></div></td></tr></table>
<table><tr><td style="max-width:370px; min-width:370px; text-align:left;"><div class="post-thumb"><img src="'.$smallimg.'" alt="Top - Style 1" /></div></td><td><div class="views"><div class="mini-counts">'.$vu.'</div><div>Views</div></div></td>
<td><div class="votes"><div class="mini-counts">'.$data['qte_vendu'].'</div><div>Solde</div></div></td>
<td><div class="status"><div class="mini-counts">'.$qte.'</div><div>available</div></div></td></tr></table></div>
</div>';
<div>
单击后,我想加载另一个 PHP 页面。这是我正在使用的脚本:
function loadXMLDocprod(num_pro) {
var xmlhttp;
var page;
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("right").innerHTML = xmlhttp.responseText;
}
}
page = 'product_o.php?num_prod=' + num_pro;
alert(page);
xmlhttp.open("GET", "page", true);
xmlhttp.send();
}
谢谢您的帮助