Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Sorry for the previous fail i've found a solution what you need to do is check if the results.geo is an object then loop if not exclude it or set it to something else i've done this</p> <p>Disclaimer This is very much so not the best solution but it is a working one to give you an idea of how to solve the issue. Hope it helps!</p> <pre><code>$(function() { function searchTweets() { var url = 'http://search.twitter.com/search.json?callback=?&amp;q=from:Eastcclothing'; $.getJSON(url, function(json) { console.log(json); var output = []; for (var i = 0, len = json.results.length; i &lt; len; i++) { if ($.isPlainObject(json.results[i].geo)) { output.push('&lt;p id="tweet"&gt;&lt;img id="tweetImage" src="' + json.results[i].profile_image_url + '" width="48" height="48" /&gt;&lt;span id="tweetText"&gt;' + '&lt;a href="http://twitter.com/' + json.results[i].from_user + '"&gt;' + json.results[i].from_user + "&lt;/a&gt; " + json.results[i].text + "&lt;br /&gt;" + json.results[i].created_at + '&lt;/p&gt;' + json.results[i].geo.coordinates + '&lt;/span&gt;'); } else { output.push('&lt;p id="tweet"&gt;&lt;img id="tweetImage" src="' + json.results[i].profile_image_url + '" width="48" height="48" /&gt;&lt;span id="tweetText"&gt;' + '&lt;a href="http://twitter.com/' + json.results[i].from_user + '"&gt;' + json.results[i].from_user + "&lt;/a&gt; " + json.results[i].text + "&lt;br /&gt;" + json.results[i].created_at + '&lt;/p&gt;' + json.results[i].geo + '&lt;/span&gt;'); } } $("div.twitter2").html(output.join('')).slideDown('slow'); }); } var timer = setInterval(searchTweets, 20000); searchTweets(); });​ </code></pre> <p>also to help heres a working jsfiddle <a href="http://jsfiddle.net/th3fallen/jc2Kf/" rel="nofollow">http://jsfiddle.net/th3fallen/jc2Kf/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload