update browser url after jquery ajax post

0 votes
asked Aug 3, 2014 in JQuery by Venky

I have a form which collects information from users and save it in database. So when the save button is clicked, it sends the serialized form data using jquery ajax post to php page and save it in the database. What I am trying to do is, I want to mimic the ajax call something like full browser refresh. That is, Once the data saved, I want to return the url of the newly saved widget from php and change/update browser url. Below is the sample code, is it really possible to update the browser url manually?

jQuery.post(
        window.location.href,
        {postData: jQuery('#widgetform').serialize()},
function(data)
{
    var result = jQuery.parseJSON(data);
    var redirect = decodeURIComponent(result['redirect']);
});
Share

Your answer

Preview

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
site design / logo / content © 2013 - 2015 pinfaq.com
...