var xmlhttp = false; try {xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { xmlhttp = new XMLHttpRequest(); } function addThis(id){ document.getElementById("FloatMenu").style.visibility="visible"; document.getElementById("FloatMenu").innerHTML=' loading..'; var command = 'document.getElementById("FloatMenu").style.visibility="hidden";'; timeout = window.setTimeout( command, 1000 ); xmlhttp.open('POST','http://beringharjo.com/add-to-cart/', true); xmlhttp.onreadystatechange = function() { if ( xmlhttp.readyState == 4 && xmlhttp.status == 200 ) { // alert(xmlhttp.responseText); document.getElementById("cart_list").innerHTML = xmlhttp.responseText; } else {document.getElementById("cart_list").innerHTML=' updating cart..';} } var poststr ='id=' + encodeURI(id) + '&value=' + encodeURI( document.getElementById("txtValue_"+id).value )+ '&size=' + encodeURI( document.getElementById("cbSize_"+id).value )+ '&item=' + encodeURI( (document.getElementById("txtIdImage")==null? 0: document.getElementById("txtIdImage").value ) ) ; xmlhttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xmlhttp.setRequestHeader('Content-length', poststr.length); xmlhttp.setRequestHeader('Connection', 'close'); xmlhttp.send(poststr); } function deleteThis(id){ xmlhttp.open('GET', 'http://beringharjo.com/delete-cart/'+id+'/'); xmlhttp.onreadystatechange = function() { if ( xmlhttp.readyState == 4 && xmlhttp.status == 200 ) { // alert('http://beringharjo.com/delete-cart/'+id+'/'); document.getElementById("cart_list").innerHTML = xmlhttp.responseText; } else { document.getElementById("cart_list").innerHTML=' updating cart..'; } } xmlhttp.send(null); }