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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:35:58+00:00 2026-06-14T03:35:58+00:00

I am implementing a twitter tweet function on my jQuery Mobile page but I

  • 0

I am implementing a twitter tweet function on my jQuery Mobile page but I keep getting undefined showing instead of the person’s username.

I am using Google Chrome by the way. As suggested by an answer I have edited the JavaScript Code.

HTML:

<!DOCTYPE html>
<html>
<head> 
  <title>Twitter Search</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> 
  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
  <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
  <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
   <script src="_/js/myscript.js"></script>
  <link rel="stylesheet" href="_/css/mystyles.css" />
</head>
<body>
<div id="home"data-role="page">
    <div data-role="header" data-position="fixed" data-theme="b">
      <h1>Choose your Query</h1>
    </div><!-- /header -->

    <div data-role="content">   
      <ul>
        <li class="main"><a href="#tweetQ" data-transition="flip" data-search="Coventry">Coventry </a></li>
        <li class="main"><a href="#tweetQ" data-transition="flip" data-search="Birmingham">Birmingham</a></li>
    </ul>

    </div><!-- /content --> 
</div><!-- /page -->

<div id="tweetQ" data-role="page" data-add-back-btn="true">
    <div data-role="header" data-position="fixed" data-theme="b">
      <h1>The Tweets</h1>
    </div><!-- /header -->

    <div data-role="content">   
      <ul data-role="listview"  id="searchlist"> 
      <li><a href="#tweet" data-transition="flip">tweet 1</a></li>
      </ul>

    </div><!-- /content -->
</div><!-- second page -->

<div id="tweet" data-role="page" data-add-back-btn="true">
    <div data-role="header" data-position="fixed" data-theme="b">
      <h1>The account</h1>
    </div><!-- /header -->
    <div data-role="content">   
      <p>Yo</p>     
    </div><!-- /content -->
</div><!-- result page -->

</html>
</body>

JavaScript code:

$('#tweetQ').live('pageshow', loadSearch);

function loadSearch() {
console.log('data');
var search = $('#tweetQ').data('search');
var url = 'http://search.twitter.com/search.json?q='+ search;
console.log('search');
$.ajax({
url: 'http://search.twitter.com/search.json?q='+search,
dataType: "jsonp",
jsonpCallback: "tweetList",
success:
    function(tweetList) { 
                alert("success");
            }
 });
} 
function tweetList(data) {
console.log('data');
$.each(data.results, function(i, result) {
console.log(result.from_user);
console.log(result.text);
var html = '<li><a href="#tweet"><h3>'+result.from_user+ '</h3></a></li>'
$('ul#searchlist').append(html);
$('ul#searchlist').listview('refresh');
$('ul#searchlist').find("a:last").click(function() {
console.log('click');
});
});
}
  • 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-14T03:35:59+00:00Added an answer on June 14, 2026 at 3:35 am

    Your problem is on this line

    jsonpCallback: "tweetList"
    

    I believe you are trying to call the tweetList function when the request completes, in that case you should set the success property instead

    success: tweetList
    

    So your ajax call should look like

    $.ajax({
        url: 'http://search.twitter.com/search.json?q='+search,
        dataType: "jsonp",
        success:tweetList
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am implementing Twitter integration in my app. But setintialtext showing empty dialog box.
I'm looking at implementing an app getting Twitter authorization via Oauth in Java. The
I've tried implementing: http://aext.net/2009/08/perfect-sign-in-dropdown-box-likes-twitter-with-jquery/ Which works perfectly, it shows when you click the link,
I implementing my own Twitter button in my page. The url I'm passing is
Javascript and jQuery (Fancybox) question I'm using the Javascript function below for Twitter sharing
I'm implementing a Feed Project basically using Three20 Twitter sample as my reference but
So, I am implementing twitter via twitter widget pro into a wordpress theme. I'm
I followed the tutorial on https://dev.twitter.com/docs/auth/implementing-sign-twitter to use OAuth on my homepage. Everything worked
when implementing a recursive function during development, i will use a counter and exit
When implementing a hash table using a good hash function (one where the probability

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.