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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:19:04+00:00 2026-06-03T05:19:04+00:00

I have two functions that make $.getJSON calls – one looks at JSON stored

  • 0

I have two functions that make $.getJSON calls – one looks at JSON stored on server, and the other one makes a call to Flickr.

I have this:

$(document).ajaxStart(function(){ 
        alert('requeststart');
        //$('#loading').show(); 
    });

which works when $.getJSON is called with some given path, but it does not raise an alert when $.getJSON makes the call to Flickr. The Flickr call works, and everything loads as it should… it doesn’t fire ajaxStart however. (I’m using ajaxStart and ajaxStop to show a loading-gif)

Any ideas?

Here is the function that calls Flickr :

$('#submit').on("click", function (evt) {
    evt.preventDefault();
    var tag = $('input').val();
    if (tag == "") {
        alert("please enter a tag");
    }
    else {
      $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",{tags: tag, tagmode: "any", format: "json" },
      function(data) {
        $.each(data.items, function(i,item){
            var name = names[index];
            $("#" + name).empty();
            $('<img src="' + item.media.m.replace("_m.jpg", ".jpg") + '" />').appendTo("#" + name);
            $('<a href="' + item.link + '"> ' + item.title + '</a>').appendTo("#" + name );
            index ++;
            if (i==5) { 
                index = 0;
                }       
        });
      });
    }
});
  • 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-03T05:19:05+00:00Added an answer on June 3, 2026 at 5:19 am

    jQuery only fires those events (ajaxStart and ajaxStop) if it internally uses the XMLHttpRequest object.

    However if you request data from a different domain using a callback parameter (JSONP), jQuery does not use XMLHttpRequest, instead it accomplishes that by inserting a <script> tag.

    That’s why the events get not fired.


    As a workaround you could start your loading animation just before the $.getJSON call, and stop it inside the function(data) {.. block.

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

Sidebar

Related Questions

I have two functions that are very similar and i'd like to make a
I have two PHP functions - one that builds a html form and another
I have two buttons on a page that trigger two functions that make two
I have two functions and i want to make it like one. function 1
I have two functions that have different enough logic but pretty much the same
I have two functions that are supposed to encrypt and decrypt a string but
Say I have two functions that expect ...rest parameters private function a(...myParams):void { trace(myParams.length);
I have created two functions that sum and subtract the numeric values of two
So I have two jquery functions that bassically do the same, but on 2
I have two fields that I'd like to match. (already done the validation functions

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.