I have here a code that saves the data of the main.php contents
When viewing a certain list, I use a URL parameter for the php to generate.
ex: main.php?v=323&p=1
Now the problem is, I want it to be remove when I save the contents after I made changes.
Here is the code I use for saving the form contents.
$.ajax({
type:'POST',
url:'/AJAXsave.php',
cache:false,
async:true,
global:false,
dataType:"html",
data:$('#form1contents').serialize(),
timeout:10000
});
I want those parameters to be removed (?v=323&p=1) upon the completion of the ajax post.
Just add the “complete” or the “success” function to your Ajax call:
According to the jQuery API: complete – A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The jqXHR (in jQuery 1.4.x, XMLHTTPRequest) object and a string categorizing the status of the request (“success”, “notmodified”,”error”,”timeout”,”abort”, or”parsererror”). As of jQuery 1.5, thecomplete setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event. jQuery Ajax