0byt3m1n1
Path:
/
data
/
17
/
1
/
18
/
11
/
1670011
/
user
/
1801231
/
htdocs
/
js
/
[
Home
]
File: script.js
<script language="Javascript" type="text/javascript"> function check_num() { if(event.keyCode<48 || event.keyCode>57) { event.keyCode=0; } } //Checking Browser AJAX compitability function getHTTPObject() { if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP"); else if (window.XMLHttpRequest) return new XMLHttpRequest(); else { showDialog('Error','Your browser does not support AJAX.','error',2); //alert("Your browser does not support AJAX."); return null; } } //Creating OBJECT function createObject() { var request_type; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer") { request_type = new ActiveXObject("Microsoft.XMLHTTP"); } else { request_type = new XMLHttpRequest(); } return request_type; } var http = createObject(); //Update Cart function update_cart(id) { var up1=id; var up2='quantity_'+id; var prod_quantity=document.getElementById(up2).value; var up3='rate_'+id; var rate=document.getElementById(up3).value; var up4='weight_'+id; var weight=document.getElementById(up4).value; httpObject = getHTTPObject(); if (httpObject != null) { var prod_quantity=document.getElementById(up2).value; var rate=document.getElementById(up3).value; if(prod_quantity==0) { alert('Minimum quantity allowed is 1'); } else { httpObject.open("GET", "update_product.php?temp_id="+up1+"&&prod_quantity="+prod_quantity+"&&rate="+rate+"&&weight="+weight, true); httpObject.send(null); window.location.href='index.php?page=view_cart'; } } } //onsale Update Cart function onsale_update_cart(id) { var up1=id; var up2='quantity_'+id; var prod_quantity=document.getElementById(up2).value; var up3='rate_'+id; var rate=document.getElementById(up3).value; var up4='weight_'+id; var weight=document.getElementById(up4).value; httpObject = getHTTPObject(); if (httpObject != null) { var prod_quantity=document.getElementById(up2).value; var rate=document.getElementById(up3).value; if(prod_quantity==0) { alert('Minimum quantity allowed is 1'); } else { httpObject.open("GET", "update_product.php?temp_id="+up1+"&&prod_quantity="+prod_quantity+"&&rate="+rate+"&&weight="+weight, true); httpObject.send(null); window.location.href='index.php?page=onsale_view_cart'; } } } </script>