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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:41:12+00:00 2026-05-22T15:41:12+00:00

Need some advise on what I am doing wrong during client JSON parsing… Tips

  • 0

Need some advise on what I am doing wrong during client JSON parsing… Tips and comments welcome my code returns nothing. Debugger doesn’t show anything useful either.

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){                   
        var htmlString = "test";
    $.getJSON("http://search.twitter.com/search.json?callback=functionName&q=%23csharp", functionName);

    function functionName(data) {

            $.each(data.items, function(i,item){
            htmlString += item.content + "<br>";
            });
            $('#test').html(htmlString);
        }

    });
</script>

</head>
<body>
<div id="test"></div>

  • 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-05-22T15:41:12+00:00Added an answer on May 22, 2026 at 3:41 pm

    Don’t specify the name of your callback function. jQuery will do that for you. The function that handles the JSONP request is specially constructed to allow you to use your function as normal and to provide other useful features.

    Do callback=? instead:

    $.getJSON("http://search.twitter.com/search.json?callback=?&q=%23csharp", functionName);
    

    The other problem is with this:

    $.each(data.items, function(i,item){
    

    You’re iterating over data.items. This doesn’t exist in the response. You then ask for item.content. This doesn’t exist either. I don’t know what JSON you’re designing your code for, because it’s not the JSON twitter sends.

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

Sidebar

Related Questions

What sort of conventions would you advise when doing some distance work (say through
I need some advice on a little project im doing. I have a database
I need an explanation regarding some advice I got on this site. I'm doing
I need to do some UML diagrams, and doing the work right in Eclipse
need some advice. I'm doing a project on RoR, and do not sure what
I need some advice as to how I easily can separate test runs for
I need some advice on what kind of pattern(s) I should use for pushing/pulling
I need some advice from experts :) I will develop a website using PHP
I need some advice, what is the rule of the thumb when creating Rails
I need some advice on techniques to perform page redirect in asp.net. Which one

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.