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

  • SEARCH
  • Home
  • 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 7853813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:48:46+00:00 2026-06-02T19:48:46+00:00

Hi I written the ajax call inside if(confirm…. condition but it is not going

  • 0

Hi I written the ajax call inside if(confirm…. condition but it is not going to my ajax page. If i write $.get outside of if(confirm(…. then it is working fine.

What is the problem. please tell me some one.

function ConfirmSave() {    
    if (confirm("Do You Want to Save the test?")) 
    {          
        $.get('../Common/Ajax.aspx',{action:"UpdateExamDuration",UserExamMapID:UserExamMap});        
    }                
    document.location.href = "../Reports/Report-Card.aspx";       
}
  • 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-06-02T19:48:47+00:00Added an answer on June 2, 2026 at 7:48 pm

    Ignoring the trailing brace } (probably just left that in there, right?) it worked for me, in that the ajax request was fired. I saw this because I had persist mode on in FireBug (meaning that request was still visible after I was redirected with the last line). What you want to do is put the document.location.href inside the $.get callback, meaning it will only run once it has completed:

    if (confirm("Do You Want to Save the test?")) 
        {          
            $.get('../Common/Ajax.aspx', {action:"UpdateExamDuration",UserExamMapID:UserExamMap}, function(data){document.location.href = "../Reports/Report-Card.aspx";});        
        }                
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DIV which is written via an ajax call to a perl
I have a webpage that makes an ajax call to get some data. That
I'm going to use a time interval to call function autoSave(). Inside the function
I have an Ajax call written in prototype and need to convert it to
I have written below code to make an ajax call using jquery: $.ajax({ url:
When the following code is retrieved via an ajax call no validators are written
I have an Ajax post call written in a separate .js file which I
I've written a Drupal block and an ajax call to refresh it(block content) whenever
I'm having issues with an ajax call to an asmx page that returns a
I've never written Ajax before and I am currently trying to code up an

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.