I have this onclose function for a window that in it it is suppose to grab data from the child window and store it the parent the parent then sends it via ajax to and jsp to store the data in a database. The code is shown below
Can anyone tell why this isn't working and/or how to fix it?
Code:
var auditpop;
function auditPopup(){
var map = {"userid" : temp_user};
jQuery.ajax({
type: "GET",
url: '/auditwizard-portlet/checkInProgress.jsp',
dataType: "html",
data: map,
global: true,
success: function(responseHTML){
var audit_war = "/auditwizard-portlet/view.jsp?userid=<%out.print(users);%>";
auditpop = dhtmlmodal.open("auditbox","iframe",audit_war,"Athena Audit Wizard","width=1180px,height=700px,scrolling=1,center=0,top=5px,left=5px");
auditpop.onclose = function(){var audit_data = auditpop.document.getElementById("audit_main_div").innerHTML;
var map = {"app" : auditpop.auditedApp
, "user" : <%out.print(users);%>
, "time" : auditpop.timestamp
, "data" : audit_data};
var save_url = "/auditwizard-portlet/SaveAuditToDB.jsp?random="+Math.floor(Math.random()*1000);
jQuery.ajax({type: "GET",url: save_url,dataType: "html",data: map,global: true,
success: function(responseHTML){
alert("Save Successful");
},
error: function(xhr, status, e){
if(xhr.status ==500){
alert("Please Contact Athena with error description");
}else if(xhr.status == 404){
}else{
alert("Error has occured with "+xhr.status);
}
}
});
};
},
error: function(xhr, status, e){
if(xhr.status ==500){
alert("Please Contact Athena with error descript");
}else if(xhr.status == 404){
}else{
alert("Error has occured with "+xhr.status);
}
}
});
Comment