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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:09:09+00:00 2026-06-16T20:09:09+00:00

I have the following code below: <!DOCTYPE html> <html lang=en> <head> <title>HTML</title> <script src=http://code.jquery.com/jquery-latest.min.js></script>

  • 0

I have the following code below:

<!DOCTYPE html>
<html lang="en">
    <head>

        <title>HTML</title>

        <script src="http://code.jquery.com/jquery-latest.min.js"></script>

        <script>
            $(document).ready(function() {

                $("#b1").click(function(event) {

                    var pm_url = 'http://www.flickr.com/services/rest/?method=flickr.test.echo&format=json&jsoncallback=wooYay&api_key=52c5c9441e7965eb55b7e54246bc6abf';

                    $.ajax({
                        url : pm_url,
                        dataType : 'jsonp',
                        jsonpCallback : 'wooYay',
                        jsonp : 'callback',
                    });

                function wooYay(data) {
                    alert(data);
                    console.log('hi');
                };  

                });

            });
        </script>
    </head>

    <body>
        <div>
            <button id="b1">
                Click Me!
            </button>
        </div>
        <div class="results"></div>

    </body>
</html>

When I view this in Google Chrome dev tools, I clearly see a response like below:

wooYay({"method":{"_content":"flickr.test.echo"}, "format":{"_content":"json"}, "jsoncallback":{"_content":"wooYay"}, "api_key":{"_content":"52c5c9441e7965eb55b7e54246bc6abf"}, "callback":{"_content":"wooYay"}, "_":{"_content":"1357519661919"}, "stat":"ok"})

But somehow the function wooYay never executes. Also I want to keep the function wooYay in the code block. Could someone please tell me where the error is?

Thanks,
Jim

  • 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-16T20:09:10+00:00Added an answer on June 16, 2026 at 8:09 pm

    The biggest issue is you are confusing jsonCallback with the AJAX success callback.

    The wooYay in the jsonCallback is to define the wrapper for the response which you see in response data you posted.

    jQuery also unwraps the data contained within this wrapper using the name provided or the one it creates if you don’t provide one

    However this will not run the function you named wooYay. This needs to be run in the success callback of $.ajax.

    Although it is unorthodox to define your function wooYay inside the clcik handler it does work as follows:

    $("#b1").click(function (event) {
    
      var pm_url = 'http://www.flickr.com/services/rest/?method=flickr.test.echo&format=json&jsoncallback=wooYay&api_key=52c5c9441e7965eb55b7e54246bc6abf';
    
      $.ajax({
        url: pm_url,
        dataType: 'jsonp',
        jsonpCallback: 'wooYay',
        jsonp: 'callback',
         /* added success callback*/
        success: wooYay
      });
    
      function wooYay(data) {
        alert('See data in console');
        console.log(data);
      };
    
    });
    

    DEMO: http://jsfiddle.net/kT6dq/

    Refactored version to minimize wooYay confusion

    function responseHandler(data) {
       alert('See data in console');
       console.log(data);
     };   
    
    
     $("#b1").click(function (event) {
       var pm_url = 'http://www.flickr.com/services/rest/?method=flickr.test.echo&format=json&jsoncallback=wooYay&api_key=52c5c9441e7965eb55b7e54246bc6abf';
    
       $.ajax({
         url: pm_url,
         dataType: 'jsonp',
         jsonpCallback: 'wooYay',
         jsonp: 'callback',
         success: responseHandler
       });
     });
    

    Demo(refactored code) http://jsfiddle.net/kT6dq/1/

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

Sidebar

Related Questions

I have the following html: <!DOCTYPE html> <html> <head> <script src=http://code.jquery.com/jquery-latest.js></script> </head> <body> <span>not
I have the following code: <!DOCTYPE html> <html xmlns=http://www.w3.org/1999/xhtml> <head> <title></title> </head> <body> <style
I have following page with code as below embeded in JSP. <!DOCTYPE HTML PUBLIC
I have following 2 files as below: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
I have the following code below however am confused as to why the div
I have the following code below for list into master page <div id=header> <ul>
I have the following code below which works, but I want to insert values
i have the following code below: const char* timeformat = %Y-%m-%d %H:%M:%S; const int
I want to know is below code correct ? I have following code which
I have the following C# code below. Object first = 5; Object second =

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.