[AJAX] Balises <p> "intempestives"
Bonjour à tous,
La mise à jour de l'affichage insère deux balises <p> qui sortent de je ne sais où....
Voici le code :
(html avant modification)
Code:
<a href="/cart/" class="header-icone-cart">Votre panier : <span id="countCart">6</span> article(s)</a>
(html après l'ajout d'un produit)
Code:
1 2 3 4
| <a href="/cart/" class="header-icone-cart">Votre panier : <span id="countCart">
<p> </p>
<p> </p>
7</span> article(s)</a> |
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
function countCart() {
var xhr = getXhr();
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
document.getElementById("countCart").innerHTML = xhr.responseText;
}
}
xhr.open("GET", "/js/action_js.asp?action=countcart&no_cache="+Math.floor((Math.random()*999999)), true);
xhr.setRequestHeader("Cache-Control","no-cache");
xhr.send(null);
} |
Pourriez-vous m'aider ?
Merci d'avance.