2

i would ask, is there any way to redirect to other page with post data after file upload successfully? Here is my code:

    $(function() {
var bar = $('#bar');
    var percent = $('#percent');
 var status = $('#status');
    $('form').ajaxForm({

        beforeSend: function() {
            var percentVal = '0%';
            bar.width(percentVal);
            percent.html(percentVal);
        },
        uploadProgress: function(event, position, total, percentComplete) {
            var percentVal = percentComplete + '%';
            bar.width(percentVal);
            percent.html(percentVal);
        },
        complete: function(data) {
               location.href='upload.php'; //here i need to redirect to selected page with post request
        }
    });});

1 Answer 1

1

Think you need to post and update the html manually. Probably something like this.

complete: function(data){
    $.post('upload.php', function( data ) {
        $('body').html(data)
        window.history.pushState({"html": $('html').html() ,"pageTitle": 'title'}, "", 'upload.php');
    });
}
Sign up to request clarification or add additional context in comments.

2 Comments

loading page content, but not getting it with post.
no, it doesn't sending post data. I receiving only a page without set data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.