Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7430575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:09:47+00:00 2026-05-29T09:09:47+00:00

I am using $.post to send a json structure built out of user input:

  • 0

I am using $.post to send a json structure built out of user input:

$.post(
    url1,
    {'input': JSON.stringify(input)},
    function(data) {
        if (data['status']) window.location.href = url2;
        else window.location.href = url1;
    }
);

A redirection always occurs after the post. My problem is that a browser seems to be inactive during the post and does not show any activity (i.e. loading progress) until the redirection starts, which results in circa 1 second when seemingly nothing is happening. By activity I just mean the standard ways of browsers to tell a user that it is loading a page (e.g. progress circle shown on my firefox tabs). Is there any way to invoke this standard behaviour as soon as the posting starts?

EDIT: Some people were asking why I don’t simply use the standard form submission. Well it is because the data I need to send are kinda complex to build and I don’t know if something like this can be done by standard (not-ajax) means. This is how I build the data:

var input = [];
$('.shopCat > p > input').each(function() {
      input.push({
        'id': $(this).closest('div').attr('id'),
        'name': $(this).val(),
        'parent': $(this).closest('div').attr('data-parent');
    });
});

Is it possible to build and post such data with a standard post form? (So i am actually asking two questions now.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:09:49+00:00Added an answer on May 29, 2026 at 9:09 am

    Well, you can’t force the browser to appear busy. But you can set the cursor to busy

    $(document).css('cursor','wait');
    $.post(
    url1,
    {'input': JSON.stringify(input)},
    function(data) {
        if (data['status']) window.location.href = url2;
        else window.location.href = url1;
    
    }
    );
    

    Although it might be better to not use ajax, just use normal form submission, since you chose to redirect afterwards anyways.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to send my data in form of json to server using post
I am trying to send data, in json format to my webservice, using POST.
From a webpage, I need to send JSON data using POST method to a
I am using $.ajax function to send json data to serverside function. var jsonObjects
I am trying to get send json from my javascript (using jquery post) to
How do I send AJAX data through $.ajax() in JavaScript via type: POST using
when using http post with flash that send ip address request from client computer
I have a program to send POST request to a server. I'm using cURL
How to send an http request with either post/get method using javascript as an
I am trying to send a JSON data to a Sinatra app by RestClient

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.