"title": "M 5.4 - 50km NNE of Achham, Nepal"
var USGS_day_Request = new XMLHttpRequest(); USGS_day_Request.onreadystatechange = function() { USGS_day_Reply(USGS_day_Request); }; USGS_day_Request.open("GET", url, false); USGS_day_Request.send(null); //Handle the USGS day reply function USGS_day_Reply( USGS_day_Request ) { if( USGS_day_Request.readyState==4 ) { //If we got a valid response. if( USGS_day_Request.status==200 ) { var message=""; //Parse JSON USGS_day=JSON.parse(USGS_day_Request.responseText); message="USGS 4.5+ Dayly Report"; message+="Total : "+USGS_day.metadata.count+"\n"; //Add to Seismic text display. seismic_day_txt.SetText(message); } //An error occurred else app.Alert( "USGS day Error: " + USGS_day_Request.status + USGS_day_Request.responseText); } }But are you sure you need the JSON.parse() in your success handler?
The HTTP Get sample that comes with DroidScript claims to be processing json and manages without the JSON.parse()
The error I get is:
USGS day Error: 404<!DOCTYPE html>
<!--[if lt IE 7]> <html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="ie ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<title>Oops! — File Not Found (404)</title>
<!-- 151217,221901,1 -->
<script type="text/javascript" src="/template/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="/template/js/master_20150623.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="keywords" content="aftershock,earthquake,epicenter,fault,foreshock,geologist,geophysics,hazard,hypocenter,intensity,intensity scale,magnitude,magnitude scale,mercalli,plate,richter,seismic,seismicity,seismogram,seismograph,seismologist,seismology,subduction,tectonics,tsunami,quake,sismologico,sismologia"/>
<meta name="google-site-verification" content="5Bw3LIEvwx8C0JA5hWKosAweW7kXIw0LS5OR438MOqU" />
<meta name="description" content="USGS Earthquake Hazards Program, responsible for monitoring, reporting, and researching earthquakes and earthquake hazards"/>
<!--[if lt IE 7]>
<link rel="stylesheet" href="/template/css/ietextonly.css" type="text/css" media="all" />
<![endif]-->
<!--[if gte IE 7]><!-->
<link rel="stylesheet" type="text/css" media="all" href="/template/css/reset.css"/>
<link rel="stylesheet" type="text/css" media="all" href="/template/css/master.css"/>
<!--<![endif]-->
<link rel="stylesheet" media="print" type="text/css" href="/template/css/print.css" />
<!--[if gte IE 7]><!--><link rel="stylesheet" type="text/css" href="/template/widgets/ui/ui.css"/><style type="text/css">dl.causes{margin:2em 0;}.causes dt{font-weight:bold;margin-top:1em;}.causes dd{margin-left:40px;}</style><!--<![endif]--></head>
<body>
<div id="header"><div id="usgsbanner"><div>
<a href="http://www.usgs.gov/"><img src="/template/images/usgs.jpg" alt="USGS - science for a changing world" title="U.S. Geological Survey Home Page" /></a>
<ul>
<li><a href="http://www.usgs.gov/">USGS Home</a></li>
<li><a href="http://answers.usgs.gov/cgi-bin/gsanswers?tmplt=2/">Contact USGS</a></li>
<li><a href="http://search.usgs.gov/">Search USGS</a></li>
</ul>
</div></div>
<div id="usgstitle"><div>
<p><a href="/">Earthquake Hazards Program</a></p>
<ul id="utilities">
<li class="invisiblelink"><a href="#startcontent" class="invisiblelink">Skip to main content</a></li>
<li><a href="/">Home</a></li><li><a href="/aboutus/">About Us</a></li><li><a href="/contactus/">Contact Us</a></li> <li id="search">
<form method="get" action="http://www.google.com/search" id="header-search-form" target="_blank" class="search-form">
<span class="search-wrap">
<input type="text" name="q" size="10" maxlength="50" title="Search Text" class="search-text" />
<input type="image" src="/template/images/sbox_button.gif" alt="Search" class="search-button" />
</span>
<input type="hidden" name="q" value="site:earthquake.usgs.gov" class="search-siteonly" />
</form>
</li>
</ul>
</div>
</div>
</div>
<hr />
<div id="sitenav"><ul><li><a href="/earthquakes/?source=sitenav">Earthquakes</a></li><li><a href="/hazards/?source=sitenav">Hazards</a></li><li><a href="/data/?source=sitenav">Data<span style="font-size: .85em;"> & </span>Products</a></li><li><a href="/learn/?source=sitenav">Learn</a></li><li><a href="/monitoring/?source=sitenav">Monitoring</a></li><li><a href="/research/?source=sitenav">Research</a></li></ul>
</div>
<hr />
<div id="content">
<a id="startcontent"></a>
<h1><span class="error">Oops!</span> — File Not Found (404)</h1>
<dl class="causes">
<dt>Did you follow a link on our website?</dt>
<dd>
If you reached this page from another part of earthquake.usgs.gov,
please use our <a href="/contactus/">Contact Form</a> so we can correct our mistake.
</dd>
<dt>Did you follow a link from another website?</dt>
<dd>
Please check our <strong>site map</strong> at the bottom of any of our webpages
or <a href="/search/">Search our website</a> to find the page's new location.
Do not send us an email about the broken link because it's not on our site, and we can't fix it.
</dd>
<dt>Did you type the URL?</dt>
<dd>You may have typed the address (URL) incorrectly. Check to make sure you have the correct spelling, capitalization, etc.</dd>
</dl>
</div>
<hr />
<div id="content_footer">
</div>
<hr />
<div id="sitemap">
<ul>
<li>
<a href="/earthquakes/?source=sitemap" class="first">Earthquakes</a>
<ul>
<li><a href="/earthquakes/map/">Latest Earthquakes</a></li>
<li><a href="/earthquakes/feed/">Real-time Feeds & Notifications</a></li>
<li><a href="/earthquakes/search/">Search EQ Archives</a></li>
<li><a href="/earthquakes/region.php">Info by Region</a></li>
<li><a href="/earthquakes/world/seismicity_maps/">World Seismicity Maps</a></li>
<li><a href="/earthquakes/eqarchives/">“Top 10” Lists & Maps</a></li>
<li><a href="/earthquakes/dyfi/">Did You Feel It?</a></li>
<li><a href="/earthquakes/shakemap/">ShakeMap</a></li>
<li><a href="/earthquakes/pager/">PAGER</a></li>
<li><a href="/earthquakes/eqinthenews/">Significant EQ Archive</a></li>
</ul>
</li>
<li>
<a href="/hazards/?source=sitemap">Hazards</a>
<ul>
<li><a href="/hazards/products/">Hazard Maps & Data</a></li>
<li><a href="/hazards/designmaps/">Seismic Design</a></li>
<li><a href="/hazards/apps/">Hazard Analysis Tools</a></li>
<li><a href="/hazards/qfaults/">Faults</a></li>
</ul>
</li>
<li>
<a href="/data/?source=sitemap">Data<span style="font-size: .85em;"> & </span>Products</a>
<ul>
<li><a href="/data/">Data</a></li>
<li><a href="/data/products/">Products</a></li>
</ul>
</li>
<li>
<a href="/learn/?source=sitemap">Learn</a>
<ul>
<li><a href="/learn/topics/">EQ Topics for Education</a></li>
<li><a href="http://www.usgs.gov/faq/?q=taxonomy/term/9762"><abbr title="Frequently Asked Questions">FAQ</abbr></a></li>
<li><a href="/learn/glossary/">EQ Glossary</a></li>
<li><a href="/learn/kids/">For Kids</a></li>
<li><a href="/learn/kml.php">Google Earth/KML Files</a></li>
<li><a href="/earthquakes/eqarchives/poster/">EQ Summary Posters</a></li>
<li><a href="/learn/photos.php">Photos</a></li>
<li><a href="/learn/publications/">Publications</a></li>
</ul>
</li>
<li>
<a href="/monitoring/?source=sitemap">Monitoring</a>
<ul>
<li><a href="/contactus/golden/neic.php">NEIC</a></li>
<li><a href="/monitoring/anss/"><abbr title="Advanced National Seismic System">ANSS</abbr> – United States</a></li>
<li><a href="/monitoring/gsn/"><abbr title="Global Seismic Network">GSN</abbr> – World</a></li>
<li><a href="/monitoring/volunteer/">Volunteer Monitoring</a></li>
<li><a href="/regional/asl/"><abbr title="Albuquerque Seismo Lab">ASL</abbr> – Albuquerque</a></li>
<li><a href="/monitoring/operations/">Network Operations</a></li>
<li><a href="/monitoring/helicorders.php">Seismogram Displays</a></li>
<li><a href="/monitoring/buildings/">Buildings</a></li>
<li><a href="/monitoring/nsmp/"><abbr title="National Strong Motion Project">NSMP</abbr> – Strong Motion</a></li>
<li><a href="/monitoring/deformation/">Crustal Deformation</a></li>
</ul>
</li>
<li>
<a href="/research/?source=sitemap">Research</a>
<ul>
<li><a href="/research/faults/">Characterizing Faults</a></li>
<li><a href="/research/earlywarning/">Early Warning</a></li>
<li><a href="/research/deformation/">Crustal Deformation</a></li>
<li><a href="/research/eqproc/">Earthquake Processes</a></li>
<li><a href="/research/groundfailure/">Ground Failure</a></li>
<li><a href="/research/groundmotion/">Ground Motion</a></li>
<li><a href="/research/hazrisk/">Hazard & Risk Assessment</a></li>
<li><a href="/research/monitoring/">Improving Monitoring</a></li>
<li><a href="/research/induced/">Induced Earthquakes</a></li>
<li><a href="/research/external/">External Support</a></li>
<li><a href="/research/index.php">Regional Science Activities</a></li>
<li><a href="/research/software/">Software</a></li>
</ul>
</li>
</ul>
</div>
<hr />
<div id="usgsnav">
<ul>
<li><a href="http://www.usgs.gov/laws/accessibility.html" title="Accessibility Policy (Section 508)">Accessibility</a></li>
<li><a href="http://www.usgs.gov/foia/"><abbr title="Freedom of Information Act">FOIA</abbr></a></li>
<li><a href="http://www.usgs.gov/laws/privacy.html" title="Privacy policies of the U.S. Geological Survey.">Privacy</a></li>
<li><a href="http://www.usgs.gov/laws/policies_notices.html" title="Policies and notices that govern information posted on USGS Web sites.">Policies and Notices</a></li>
<li><a href="http://www.nehrp.gov" class="nehrp">In partnership with <abbr title="National Earthquake Hazards Reduction Program">n<span class="e">e</span>hrp</abbr></a></li>
<li><a href="http://www.usa.gov/" class="usagov" title="USAGov: Government Made Easy"><img src="/template/images/usagov.jpg" alt="USA.gov" width="90" height="26" /></a></li>
</ul>
</div>
<div id="footer">
<p>
<a href="http://www.doi.gov/index.cfm">U.S. Department of the Interior</a> | <a href="http://www.usgs.gov/">U.S. Geological Survey</a><br />
Page URL: http://earthquake.usgs.gov/notfound.php<br />
Page Contact Information: <a target="_blank" href="mailto:sis_eq_q...@usgs.gov?subject=EHP%20Website%20Email%20">Contact Us</a><br />
Page Last Modified: January 16, 2014 17:46:10 UTC </p>
<small class="disclaimer"><img src="/template/images/small_offsite_arrow.gif" alt="Offsite Link" title="Offsite Link"> <a href="http://www.doi.gov/disclaimer.cfm" title="Department of the Interior - Disclaimer of Liability and Endorsement">DOI</a> and <a href="http://www.usgs.gov/laws/info_policies.html" title="USGS - Information Policies">USGS</a> link policies apply.</small></div>
<script type="text/javascript" src="/contactus/js/ContactValidator.js"></script><script type="text/javascript" src="/contactus/js/FAQFilter.js"></script><script type="text/javascript" src="/contactus/js/contactus.js"></script><script type="text/javascript" src="/template/widgets/ui/ui.js"></script><script type="text/javascript" src="/template/js/lib.20080317.min.js"></script>
<!--[if lt IE 7]><script type="text/javascript" src="/js/minmax.js"></script><![endif]-->
<!--[if lt IE 8]><script type="text/javascript" src="/template/js/offsite.js"></script><![endif]-->
</body>
</html>
//Called when application is started.function OnStart(){//USGS Seismic day activity request var USGS_day_Request = new XMLHttpRequest(); USGS_day_Request.onreadystatechange = function() { USGS_day_Reply(USGS_day_Request); }; USGS_day_Request.open("GET", url, false); USGS_day_Request.send(null); }
function USGS_day_Reply( USGS_day_Request ) { if( USGS_day_Request.readyState==4 ) { //If we got a valid response. if( USGS_day_Request.status==200 ) { var message=""; //Parse JSON USGS_day=JSON.parse(USGS_day_Request.responseText); message="USGS 4.5+ Dayly Report"; message+="Total : "+USGS_day.metadata.count+"\n"; //Add to Seismic text display. var temp,x; for (var key in USGS_day.features) { x=USGS_day.features[key].properties.title; x.replace(','," - "); //key+=1; temp+=x; } feature=app.CreateListDialog("Seismic Activity",temp);I couldn't find a way to escape a comma in a ListView but if you only need a basic ListView, this may do as an alternative https://groups.google.com/d/msg/androidscript/H-HS4LA8eps/ApYIUpK6FgAJ