AJAX and window.location.href

see there is a html line like this
<a href=”javascript:void(0);” onClick=”javascript:deleteGroup();”>Delete</a>
the delete group function is written as

function deleteGroup()
{
selectAll(null);
if (groupNames==”” || groupNames==”,”)
{
alert (“No Groups selected”);
return;
}
var a = confirm(“Are you sure you want to delete the selected groups? This change is permanent and this cannot be recovered!”);

if(a)
{
alert(groupNames);
window.location.href=”/final/admin/Egconfiggroupp.jsp?deleteGroups=”+groupNames+”&mode=delete”;
return;
}
}

It is working fine in Firefox but not in IE. Actually the control has been transferred to configgroupp.jsp and what it need to do, has been done. but it is not getting reflected in UI. it is static 😦 but when you add ” window.event.returnValue=false;” after window.location.href it is workign fine.

function deleteGroup()
{
selectAll(null);
if (groupNames==”” || groupNames==”,”)
{
alert (“No Groups selected”);
return;
}
var a = confirm(“Are you sure you want to delete the selected groups? This change is permanent and this cannot be recovered!”);

if(a)
{
alert(groupNames);
window.location.href=”/final/admin/Egconfiggroupp.jsp?deleteGroups=”+groupNames+”&mode=delete”;
window.event.returnValue=false ;
return;
}
}

What MS site says is, http://support.microsoft.com/kb/190244/en-us ,
The onclick event is overwritten by href tag etc etc….. oops. oh MS associates, why your browser keep on bugging me, while firefox is working fine?


—————————————————
*Free* software is a matter of liberty not price. You should think of “free” as in “free speech”.

Advertisements