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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:58:04+00:00 2026-06-12T00:58:04+00:00

New to Ajax calls. Need some pointers to start my learning but want to

  • 0

New to Ajax calls. Need some pointers to start my learning but want to do it with a real example.

This link: http://api.tumblr.com/v2/blog/david.tumblr.com/info?api_key=API_KEY

returns this to my browser which is a good example of data I’ll be using:

{
    "meta": {
        "status": 200,
        "msg": "OK"
    },
    "response": {
        "blog": {
            "title": "David\u2019s Log",
            "posts": 3981,
            "name": "david",
            "url": "http:\/\/www.davidslog.com\/",
            "updated": 1348785660,
            "description": "\u201cMr. Karp is tall and skinny, with unflinching blue eyes and a mop of brown hair. He speaks incredibly fast and in complete paragraphs.\u201d \u2013 NY Observer",
            "ask": false
        }
    }
}

I think I could use this as a start but definitely open to other ways:

var tumblrURL = "david.tumblr.com";

jQuery.ajax({
    url: "http://api.tumblr.com/v2/blog/" + tumblrURL + "/info",
    data: {api_key: "MY_PRIVATE_API_KEY"},
    dataType: "jsonp",
});​

But I am lost as to proper ways to parse out and get the different bits returned and use them as vars or for tests in the call.

For example, how do I get “status” or the “name”?

When the status is a 200 then I would want to make a var out of the name (“david”) and use it for other options.

Or, if the status is a 404 then I would want to do something else (like return an error).

Please, no flames. I’m trying to learn and if I get a few examples or pointers I will be able to move on to more interesting stuff. I’m OK with other aspects of jQuery so those issues should be fine.

Thanks!

  • 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-12T00:58:06+00:00Added an answer on June 12, 2026 at 12:58 am

    The jQuery.Ajax function takes an optional function parameter success:

    success(data, textStatus, jqXHR)

    A function to be called if the request succeeds. The function gets passed three arguments: The data returned from the server, formatted according to the dataType parameter; a string describing the status; and the jqXHR (in jQuery 1.4.x, XMLHttpRequest) object. As of jQuery 1.5, the success setting can accept an array of functions. Each function will be called in turn. This is an Ajax Event.

    You could set this to your own function, which would automatically execute once the request succeeds – providing you with the entire JSON blob you receive as a normal Javascript object. In your case, you could get the status of the request at data.meta.status – or the name at data.response.blog.name.

    Note that jQuery also allows for error handlers on Ajax requests, called automatically in a similar way: error(jqXHR, textStatus, errorThrown).


    Example code:

    jQuery.ajax({
        url: "http://api.tumblr.com/v2/blog/" + tumblrURL + "/info",
        data: {api_key: "MY_PRIVATE_API_KEY"},
        dataType: "jsonp",
        success: function(data, textStatus, jqXHR) {
            // Do whatever you'd like in here with your data
            console.log("Got a response from " + data.response.blog.name);
        },
        error: function(jqXHR, textStatus, errorThrown) {
            // Do whatever you'd like in here with your ERROR data
            alert("Got an error: " + textStatus);
        }
    });​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this code: new Ajax.Request('?service=example', { parameters : {tags : 'exceptions'}, onSuccess : this.dataReceived.bind(this)
I am making ajax call like this $(document).ready(function() { var abc = new Array();
There is currently this Prototype code that does a PUT: new Ajax.Request(someUrl, { method:
I am very new to ajax concept,I want to submit a form without refresh
I'm new to AJAX and PHP but I know that PHP is a server-side
im new to Mod_rewrite but problem is it ruins all my ajax and php
I'm new to ASP.NET MVC(-4). I want to make an Ajax call from my
I am completely new to Javascript/jquery world and need some help. Right now, I
What scope to php variables have with regards to AJAX calls? So for example,
I am currently working on this website , and i need some help regarding

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.