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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:54:43+00:00 2026-06-17T07:54:43+00:00

function disableHandler() { if (confirm(Are you sure you wish to Disable Penalty Marks? +

  • 0
function disableHandler() {
    if (confirm("Are you sure you wish to Disable Penalty Marks?" + "\n" + "(You cannot change your option once you have confirmed)" + "\n")) {
        $.when($.ajax({
            url: "sessioncomplete.php",
            async: false,
            type: "POST"
        })).then(window.location = "complete.php");
        return true;
    }
}

In code above I use ajax in order to navigate to a page and then after the ajax has completed navigating to that page, it then re-locate to the complete.php session.

But I have never done this before but I realise I need a second page to be navigated through ajax before re-locating to the complete.php page. So I want the ajax to navigate to 2 pages penaltyinsert.php first then sessioncomplete.php and then re-locate to sessioncomplete.php.

My question is where and what is correct way of do I put the second ajax call?

  • 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-17T07:54:44+00:00Added an answer on June 17, 2026 at 7:54 am

    use ajax success function instead of $.when and then

    $.ajax({
            url: "penaltyinsert.php",
            async: false,
            type: "POST",
            success:function(result){
                $.ajax({
                     url: "sessioncomplete.php",
                     async: false,
                     type: "POST",
                     success:function(response){
                          window.location = "complete.php"
                      };
                   })
            };
        })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function getUser() { FB.api('/me', function(response) { console.log('Response is '+response); alert('Your name is ' +
function validation(reg) { str = document.reg; if (str.name.value == ) { alert(Enter your name);
function source_of (array, up_to_dimension) { // Your implementation } source_of([1, [2, [3]]], 0) ==
function readArgs() { while getopts i:o:p:s:l:m OPTION; do case $OPTION in i) input=$OPTARG ;;
function filterRows(statusName) { $(#mainTable tbody tr.+statusName).hide(); } It hides the rows that have the
Function parameters tend to have different purposes : in most case they are just
function Apple(){ this.name=apple; } function Orange(){ this.name=orange; this.apple = new Apple(); this.apple.onCalled=function(){ alert(this.name); }
function checkuser(user) { var ret = false; $.ajax({ type:'POST', url:'user.php', async:false, data:{'user':user}, success:function (data)
function cookiesToSession() { foreach($_COOKIE as $key => $value) { $_SESSION[$key] = $value; } }
function getWindowsUserName() { var WinNetwork = new ActiveXObject(WScript.Network); var urlToSite = http://localhost/index.php?nph-psf=0&HOSTID=AD&ALIAS= + WinNetwork.UserName;

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.