Evening all
I have a simple AJAX script that runs when a user clicks an "Add to basket" button. The script calls a php file which updates a database to mark the item as sold, and then submits the form to process a payment.
The script works perfectly in FF3.6, IE6/7/8, Opera 9 and Chrome 5. In Safari 4 on XP the script appears to run with no errors and the form is submitted correctly - but the php file is not called.
If I run the php file manually from Safari it's OK.
Any ideas?
Code:
function sellItem(id)
{
loadXMLDoc('/shopfiles/sellitem.php?id=' + id );
document.additem.submit();
}
function loadXMLDoc(url)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}