????
| Current Path : /home2/morganrand/www/store/js/ |
| Current File : /home2/morganrand/www/store/js/change_price.js.bk |
// JavaScript Document
function getxmlHttpObj()
{
var xmlHttp;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
return xmlHttp;
}
function getPrice(sp_price,price,product_id,attr_arr)
{
opt_id = document.getElementById("optionsid").value;
xmlHttpObj = getxmlHttpObj();
xmlHttpObj.onreadystatechange=function()
{
if(xmlHttpObj.readyState==4)
{
document.getElementById("display_price").innerHTML = xmlHttpObj.responseText;
}
}
xmlHttpObj.open("GET","ajax_onchange_price.php?sp_price="+sp_price+"&price="+price+"&option_id="+opt_id+"&product_id="+product_id+"&product_opt="+attr_arr,true);
xmlHttpObj.send();
}
function fakePrice(option)
{
//var field = document.getElementById("display_price");
/*dprice = field.value;
switch (option) {
case '11':
dprice-= 3.20;
break;
case '20':
dprice-= 7.80;
break;
case '22':
dprice+= 3.90;
break;
case '23':
dprice+= 7.80;
break;
case '31':
dprice+= 4.00;
break;
}*/
//document.getElementById("display_price").innerHTML = dprice;
document.getElementById("display_price").innerHTML = "55.55";
}