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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:30:26+00:00 2026-06-09T08:30:26+00:00

I have a json feed which i’m currently using ajax to try and get

  • 0

I have a json feed which i’m currently using ajax to try and get the data displayed in a list format. I’ve never used a json feed before so had to learn alot from these forums.

At the moment the data is becoming undefined and not sure why. Now i know the json feed is across domain so need jsonp and a callback function as not one in url.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JSONP test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
</head>

<body>
<div id="content"></div>
<script type="text/javascript"> 
function loadgatewayJSON() {

$.ajaxSetup({ 
        global  : true, 
        dataType: 'jsonp', 
        jsonp   : 'callback',
        cache   : true,
        data: {eventTypeId:1}, 
        ajaxStart: function(){
            //$('#content').hasClass('loading');
        },
        complete: function(){ 
             //$('#content').removeClass('loading');
        }
        });

    $.ajax({

        url: '(my url for feed)',
                   success: function(data, status) { 
                        $('#content').empty();  
                        var numResults = data.length;
                        alert(data);
                        for (var i=0;i < numResults;i++) {                              
                            $('#content').append("<p>"+data[0].eventCount+"</p>");

                        };

                   },
                   error:function (xhr, ajaxOptions, thrownError){ 
                    alert("An error has occured");
                    alert(xhr.status); 
                    alert(xhr.responseText); 
                } 
        });
};
loadgatewayJSON();
</script>
<div id="content"></div>
</body>
</html>

I just wondered if anyone can spot any errors i’ve done in the code for reasons why it is pulling up undefined. I really just want a list of the events. I hope someone here could help me.

Update:

I’ve got the feed pulling now but struggling to pull the data within the json feed.

The stuff i need to pull is

“name”
“startdate”
“enddate”
“eventtype”

I assumed it was:

$('#content').empty();  
var data = name.event;

alert(data);
for (var i=0;i < numResults;i++) {                              
$('#content').append('+data[0].events+');

Sadly all this pulls up is displaying +data[0].events+ load of times

update:

Thank for the fix for this one sadly nothing seems to be displayed so assume it is the wording i’m using.

    "status": "success",
        "eventCount": 681,
        "events": [
            {

"baseUrl":                 
"pageUrl":                                 
"name":                 
"owner":        
"startDate":                 
"startTime":                 
"endDate":                 
"endTime": 

These are the feed ids and the information can be pulled using this code

success: function(data, status) { 
                    $('#content').empty();  
                    var data = data.name;
                    alert(data);
                    for (var i=0;i < data;i++) {                                
                        $('#content').append(data[0].events);

                    };

well 1 out of 2 issues fixed so yay. Today not been a waste at least. Thank you so much for your help as well 🙂

  • 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-09T08:30:30+00:00Added an answer on June 9, 2026 at 8:30 am

    What you have done is wrong,
    $('#content').append('+data[0].events+');

    You should have done
    $('#content').append(data[0].events);

    '+data[0].events+' is treated as a string and the output is as expected.

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

Sidebar

Related Questions

I have a JSON feed (which I don't directly control, I have to ask
I have a json feed from this URL which contains 20 fields and I
I have a JSON feed data with lots of user relation in it such
Hi, i have been having some problems using JSON data in flash builder lately
I am using ASP.net to display data on my calendar. I have my feed
I have the following code which loads a JSON feed and creates all the
I have an RP for which I've built a login page using the Json
My app pulls a json data feed , I have just added the reachability
i have a simple JSON feed which returns an image path, and a set
I have an array which includes URLs of JSON feeds. I am using ASIHTTPRequest

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.