function choose_size(size_number){ $("#id-size_number").click(function(){ $("p").hide(); }); } var text = ["Welcome", "Hi", "Sup dude"]; var counter = 0; var elem = document.getElementById("changeText"); var inst = setInterval(change, 1000); function change() { var xhr; if (window.XMLHttpRequest) { // Mozilla, Safari, ... xhr = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE 8 and older xhr = new ActiveXObject("Microsoft.XMLHTTP"); } var book = 0; var data = 'chatid='+ encodeURIComponent(book); xhr.open("POST", "../../configuration/show_cart.php", true); xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.send(data); xhr.onreadystatechange = display_data; function display_data() { if (xhr.readyState == 4) { if (xhr.status == 200) { //alert(xhr.responseText); document.getElementById("cart").innerHTML = xhr.responseText; document.getElementById("mobilecart").innerHTML = xhr.responseText; document.getElementById("sm-cart").innerHTML = xhr.responseText; } else { // alert('There was a problem with the request.'); } } } }