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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:45:15+00:00 2026-06-01T02:45:15+00:00

I am using jQuery to get data from server. Data is coming. Here what

  • 0

I am using jQuery to get data from server. Data is coming. Here what i am doing

 $.ajax({

     url: "EventCalendar_Review",
     dataType: "json",
     success: function(data) {

         console.log(data);
         var a = data.eventTitle;
         var b = data.fromDate;
         var c = data.toDate;
         var d = data.url;

     }, //end of success

     complete: function(request, textStatus) {
         var req = request;
         var status = textStatus;            
     } //end of complete

}); //end of .ajax

data variable has its data in JSON format something like this

[object{ eventId=1, eventTitle="Khan to hold maide", fromDate="2012-03-06", toDate= "2012-03-07" more...}, Object { eventId=2, eventTitle="India tie not about revenge", fromDate="2012-03-06", more..}, ...]

Data is printing in the console. But when i am using just below console.log(data)

console.log(data);
var a = data.eventTitle;
var b = data.fromDate;
var c = data.toDate;
var d = data.url;

Then i am getting a, b, c and d undefined. a sholud get value of eventTitle(Khan to hold maide) and so on. Why i am getting undefined?

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-01T02:45:16+00:00Added an answer on June 1, 2026 at 2:45 am

    Assuming the something like makes it a valid JSON object (http://jsonlint.com), then you’ve got an array of objects:

    for (var i=0;i<data.length;i++) {
        var thisOne = data[i];
    
        var a = thisOne.eventTitle;
        var b = thisOne.fromDate;
        var c = thisOne.toDate;
        var d = thisOne.url;
    
        // do something with these variables.
    }
    

    If you just want the first object, you can use data[0] to access it:

    var a = data[0].eventTitle;
    var b = data[0].fromDate;
    var c = data[0].toDate;
    var d = data[0].url;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery to get back some JSON data from the server. I
I read from the jQuery website, that get() loads data from the server using
I m using autocomplete from http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ i managed to get data from server in
Using jQuery Ajax to fetch data from local server: it works well with IE8
I'm using AJAX to get data from server. The following is the php file.
I am trying to get some data back from a server using jQuery $.getJSON
I am trying to get a piece of data back using jQuery ajax via
I'm writing a Google Maps app that requests data from the server using jQuery's
well I havn't really ever using jquery to grab data from a server.. and
I'm using JSONP to get data from a server. The more typical method of

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.