Hi there,
I believe I am having trouble with the response that is received by the Ajax request.
I have posted something similar to this but the response returned was XML not plain text (or html). I am guessing this should be easier but I can't figure out or find a suitable method that works. (or I am just doing it wrong).
Everything works fine in Chrome and Firefox. IE7 seems to mess up. I've got as far as believing that I need to include some sort of Active X Object code for IE, but cant find how to integrate it with what I have.
Here's the code I have that works in the other browsers:
function addToBasket(itemId,itemPrice,multiplier,type)
{
a = itemId;
b = itemPrice;
c = multiplier;
d = type;
var request = new Ajax.Request
('basket.php',
{ method: 'get',
parameters: 'itemid=' + a + '&itemprice=' + b + '&multiplier=' + c + '&producttype=' + d,
onComplete: responseReceived }
);
}
// The callback function
function responseReceived(xmlHTTP)
{
if(xmlHTTP.responseText=="basket error")
{
document.getElementById('basketerror').innerHTML = "That item is already in your basket.";
}
else
{
document.getElementById('basketquantity').innerHTML = xmlHTTP.responseText;
document.getElementById('basketerror').innerHTML = "";
}
}
Any help would be greatly appreciated.
Cheers
Danny