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 6743735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:59:49+00:00 2026-05-26T11:59:49+00:00

I have once ajax call which does connect to database, sets one flag in

  • 0

I have once ajax call which does connect to database, sets one flag in database and waits for one file to be created by some other process which looks up the flag.

Till the file is created on server, ajax keeps waiting. Once file is created, ajax reads the file and displays the content.

Now issue is that sometime the backend process which creates the file, stuck into socket issue, and never created the file, but ajax keeps waiting in that case, which gets timedout only when its timeout occurs,

What all I want to show a stop request button, which could stop current ajax request as timeout is long, and user could want to stop it prior to timeout.

Here is what I tried, I modified the code which keeps looking the existence of file, and added a session variable check , like if Session(“AbortCheck”) = true then exitout from the script.

and placed another ajax call to update the sessin variable so that on loop when the script will find session = true it will immediately stop the request.

While debugging I found that my my new ajax request which updates the session variable actually executed only when the first ajax is completed. and therefore its never stopped on user request to stop the request.

Could anyone let me know how to stop a running ajax (which is taking time) on user input ?

Thanks

  • 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-26T11:59:50+00:00Added an answer on May 26, 2026 at 11:59 am

    I have fixed the server side execution by removing the loop from server side which continuously checks for file, and put a loop in js file to re check the same, and for handshake , if file is not found on server, I pass message as waiting to ajax and another flag for abort check from jquery, which solved the issue.

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

Sidebar

Related Questions

Have an ajax call to updateUser which does this: puts session[:user_id] user = User.find(params[:user_id])
I have an AJAX call, which is doing this call every 5 seconds and
I have a dropdown list which is populated via a jquery ajax call when
I have a form which uses $.ajax on submit to call a bash script
I have an ajax call in jQuery loading some elements into a div. The
I have the following Ajax call which send form data to a page and
I have a page where I load a table of information using ajax. Once
I need to delete my input file securely once I have finished with it,
I have a form, in which I need to send data selected via AJAX
I'm having some issues with a jQuery AJAX call. My code works fine when

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.