To reload current page is JS:
location.reload();
To reload parent window
window.opener.location.reload();
More codes:
if(confirm('Are you sure to swap '+section1 + ' ' +stakeholder_name1+' with ' +section2 + ' ' +stakeholder_name2 +' in '+course+'? Click OK to proceed. Click Cancel to cancel')) {
$.post("../_ajaxParts/SITAAssign/SITAAssignPOST.php", {funct:'updateSITAswap',
courses_offered_id1:courses_offered_id1,
stakeholder_id1:stakeholder_id1,
section1:section1,
assignedID1:assignedID1,
courses_offered_id2:courses_offered_id2,
stakeholder_id2:stakeholder_id2,
section2:section2,
assignedID2:assignedID2
}, function(data){
formatJson(data,"div#notice", function(json){
if(json.data['success']==1){
location.reload();
window.opener.location.reload();
formatJson('{"success":"Swap sections successfully."}', "div#notice", null);
}else if(json.data['success']==-1){
alert("Can not swap due to different ranks");
}else if(json.data['success']==-2){
alert("Can not swap due to empty contract");
}else{
formatJson(json.data['error'], "div#notice", null);
}
});
});
}
No comments:
Post a Comment