I have a function made in javascript, using jQuery. I use this to send some info to the server
function cart(val, theImg)
{
var url = location.protocol+'//'+location.hostname+'/';
if(!theImg.hasClass('added'))
{
jQuery.post(url,{ajax:'1',compedit:'shopping-cart',q:'1',tocart:val},function(result){
theImg.attr({'src':'/media/images/substract_from_cart.png','title':'Substract from cart','alt':'Substract from cart'}).addClass('added');
jQuery('.btip').text('Substract From Cart');
}, 'text');
}
else
{
jQuery.post(url,{'ajax':'1','compedit':'shopping-cart','q':'0','tocart':val},function(result){
theImg.attr({'src':'/media/images/add_to_cart.png','title':'Add To Cart','alt':'Add To Cart'}).removeClass('added');
jQuery('.btip').text('Add To Cart');
}, 'text');
}
}
My problem is, that this function does not send the data to the server in Webkit browsers (Chrome, Safari)!
Any help would be appreciated!
the first
postisn’t right add':