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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:36:32+00:00 2026-06-04T11:36:32+00:00

I am attempting to run the following code snippet: var myVar1 = $.getJSON(‘myurl’, function(json)

  • 0

I am attempting to run the following code snippet:

var myVar1 = $.getJSON('myurl', function(json) {
    console.log("debug1", json);
});
var myVar2 = $.getJSON('myurl2', function(json2) {
    console.log("debug2", json2);
});

And I never see the “debug2” entry appear in my console log. When I check the status of myVar2 after the requests have completed, I see it populated with the correct data. When I append a .complete() statement at the end of the of the second .getJSON() request, the .complete() function will fire correctly.

Using jQuery 1.7.2 and lastest stable of google chrome. Why will the second callback function not fire?

  • 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-04T11:36:35+00:00Added an answer on June 4, 2026 at 11:36 am

    Try :

    var myVar2 = $.getJSON('myurl2').success(function(){
        console.log("debug2 - success");
    }).error(function(){
        console.log("debug2 - error");
    });
    

    You will probably see the error message and not success. I would guess that ‘myurl2’ does not exist though it could be that it does exist but the script makes an HTTP response with an error heading. I think a JSON decode failure will also fire the error callback.

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

Sidebar

Related Questions

I have the following code (attempting to log a user in programatically): List<GrantedAuthority> authorities
I am attempting following code to create multiple instances of a class at run-time
When attempting to run the following assembly program: .globl start start: pushq $0x0 movq
I am attempting to run the following command in KornShell (ksh): set -A INDEXES
I'm attempting to run the following command in PHP (on Ubuntu): <?php if (exec(/home/johnboy/ffmpeg/ffmpeg
I am getting the following error message when compiling or attempting to run my
I am trying to run the following code to loop around a recordset and
If one were to compile and run the following code, one would find that
I have the following PHP code which is attempting to check for password complexity
I'm attempting to run TextTransform.exe to generate code using a T4 template file. The

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.