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

The Archive Base Latest Questions

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

In my windows gadget code in made an ajax (POST) call using jQuery in

  • 0

In my windows gadget code in made an ajax (POST) call using jQuery in SettingsClosing(event). I watch the ajax call execution through Fiddler. Ajax call is returning the desired results.But it is not triggering success callback ajax. I tried the same code in OnPageLoad() event of main view it is working fine there, My code is like this

function Login(username, password) {
    var url = "http://example.com/Auth.php";
    var data = { pusername: username, ppassword: password };
    jQuery.support.cors = true;
    $.ajax({
        type: "POST"
            , dataType: "json"
            , url: url, data: data
            , success: function (refresh_token) {
                System.Gadget.Settings.write("success", "true");
                System.Gadget.Settings.write("dd", refresh_token);
                var tok = refresh_token['refreshtoken'];
                var name = refresh_token['name'];
                System.Gadget.Settings.write("name", name);
                System.Gadget.Settings.write("refreshtoken", tok);

            }
                , error: function (XMLHttpRequest, textStatus, errorThrown) {
                    System.Gadget.Settings.write("login_error", errorThrown);
                    System.Gadget.Settings.write("login_STATUS", textStatus);
                }
    });
}

function SettingsClosing(event) 
{
    //use this question to now if setting was closed with OK button
    if (event.closeAction == event.Action.commit)
    {
        var username = $('#txtpUsername').val();
        var password = $('#txtpPassword').val();
        Login(username, password);

    }
}

Any help is appreciated.

  • 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-11T12:17:56+00:00Added an answer on June 11, 2026 at 12:17 pm

    Because the ajax call is asynchronous, it would seem likely that the code doesn’t have the opportunity to run before the operation completes. You could try setting event.cancel to true, and then triggering the close manually after your ajax call completes. MSDN reference: http://msdn.microsoft.com/en-us/library/windows/desktop/ms723677(v=vs.85).aspx

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

Sidebar

Related Questions

I've created a Windows Gadget using JQuery to call the oAuth-Service of Yammer: https://www.yammer.com/oauth/request_token
Does anyone know of a way I can code-profile my Windows Sidebar Gadget? I've
I have a website for my gadget files and I’ve made a windows 7
so right now I'm writing a Windows 7 Gadget using Javascript (w/HTML) that will
I am writing a Windows Sidebar Gadget using JavaScript. Now I would like to
I created a Windows desktop gadget using GWT RPC but how could I make
It opens neither a tab nor a window: the code for a Google Gadget
i try to debug a windows gadget. Just-In-Time debugging fires up and i can
I have developed a windows sidebar gadget which plays videos in a flash player,
I'm closing in on finishing a Windows Desktop Gadget that downloads plugins from my

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.