Hi friends i want to delete some data while the user close the browser… this is my code it’s working fine in IE8 but not working in other browser… please find the issue… thanks in advance
<script language=“javascript”>
function fnUnloadHandler()
{
var link = document.getElementById(‘hiddenbox’).value;
xmlhttp=null;
if (window.XMLHttpRequest)
{// code for Firefox, Opera, IE7, etc.
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject)
{// code for IE6, IE5
xmlhttp=new ActiveXObject(“Msxml2.XMLHTTP”);
}
/*
try{
// Opera 8.0+, Firefox, Safari
xmlhttp = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}*/
if (xmlhttp!=null)
{
}
else
{
alert("Your browser does not support XMLHTTP.");
}
if(link != ‘payment’ || link == ‘’)
{
xmlhttp.open(“GET”,“index.php?option=com_parents&task=deletecart”,true);
xmlhttp.send(null);
}
}
window.onbeforeunload = fnUnloadHandler;
</script>