Ajax - Page Refreshes to a blank White Page
Hi
Im doing an Ajax call which calls a Java struts 2 action. This action basically just does a DB update. There is no data being returned to the client. The page refreshes to a blank white page. I dont want his to happen. I want a pop up box on my page. The ajax call happens when i press a save button. Here is the jquery code:
$.ajax({
type: "POST",
url: "saveData.action",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function() {
msgBox("Saved Changes");
},
error: function(){
msgbox("Falied to save Changes");
}
});
Im a Jquery newbie. As far as I can gather JQuery is expecting data back. It gets nothing back (which is what I want). But Jquery does a refresh with this. Hence why my page goes to a blank white page. I think this is what is happening
I was thinking of putting in my dummy div and loading the blank/empty no html into the dummy div but there has to be a way to stop the white page showing up. I dont get pop up boxes either as shown in code above:
Alan