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://jogjamarket.com/add-to-cart/add-this-product-to-cart.html', 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 ); if(document.getElementById("txtTotalGroupCombination")!=null){ for(var i=1;i<=document.getElementById("txtTotalGroupCombination").value;i++){ poststr+='&attribute[]'+i+'=' + encodeURI( document.getElementById("cbAttribute_"+i).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://jogjamarket.com/delete-cart/'+id+'/delete-this-product-from-cart.html'); xmlhttp.onreadystatechange = function() { if ( xmlhttp.readyState == 4 && xmlhttp.status == 200 ) { // alert('http://jogjamarket.com/delete-cart/'+id+'/'); document.getElementById("cart_list").innerHTML = xmlhttp.responseText; } else { document.getElementById("cart_list").innerHTML=' updating cart..'; } } xmlhttp.send(null); }