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

  • Home
  • SEARCH
  • 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 7803475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:35:45+00:00 2026-06-02T01:35:45+00:00

PhoneGap will print out the json from twitter below. However when I use any

  • 0

PhoneGap will print out the json from twitter below. However when I use any other url for my ajax.open it just shows a blank screen.
Apologies for messy code layout

 <pre>
</head>
<body>
 <script type="text/javascript" src="phonegap.js"></script>
<script type="text/javascript">
         function appReady(){

         }
         document.addEventListener("deviceready", appReady, false);
         var ajax = new XMLHttpRequest();   
         ajax.open("GET","http://search.twitter.com/search.json?q=bacon",true);

         ajax.send();

         ajax.onreadystatechange=function(){
         if(ajax.readyState==4 && (ajax.status==200))
         {
           document.getElementById('main').innerHTML = ajax.responseText;
         }
       }
       </script>
      Hello
 <div id="main">
 </pre>

Using eclipse I created a Webserver and started coding these requests from my localhost and using the code below, minus the phonegap.js in the script tag and it worked fine for calling html from /Test2.html”. I removed the “phonegap.js” because on my local machine its not using phonegap, I did replace it with “Test.js”, which just contains this code, which I obtained from W3school documentation on XMLHttpRequest:

When I try to get my emulator to call /Test2.html it shows a blank screen.Also from my own server I am unable to call twitter json, I expect this due to cross domain protection is back on since im not working with phonegap.

Can anyone tell me why I am unable to view Test2 and other urls using this code on my Emulator.
also does anyone know of any other online jsons available, I tried a google and yahoo ones but they also dont seem to work on either.

function handler() {
 if(this.readyState == this.DONE) {
if(this.status == 200 && this.responseXML != null && this.responseXML.getElementById('test').textContent) 
{
  // success!
  processData(this.responseXML.getElementById('test').textContent);
  return;
}
// something went wrong
processData(null);
}
}
  • 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-02T01:35:47+00:00Added an answer on June 2, 2026 at 1:35 am

    You might need an “API Key” to access other JSON streams. Twitter does not require such a key.

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

Sidebar

Related Questions

I'm planning on creating an app which will utilise Phonegap, however the app is
I'm working on a mobile app with Phonegap which will use Geolocation. I used
If I use PhoneGap will I build web app as usual? How does PhoneGap
I'm hoping to be able to use PhoneGap for my app. I will have
In PhoneGap how do I create/open a database in Android? I am using this
I've written a PhoneGap plugin for Android that gets called from the browser on
I am working on PhoneGap for android and it use cordova-1.5.0.jar, I want to
I've started a project in PhoneGap which will utilise Sencha Touch 2. I tried
We are setting up a sourcecode repository for a Phonegap app (it will be
I am working on a phonegap app that will be submitted to the itunes

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.