diff --git a/2-0/script.js b/2-0/script.js index 9e6d550..845818b 100644 --- a/2-0/script.js +++ b/2-0/script.js @@ -22,13 +22,13 @@ $(document).ready(function() { } ]; for (var i = 0; i

"); + if (data[i].text) { + $('#news').append("

"); } } $("button").click(function() { - if (!this.attr('data-href')) { - document.location = this.attr('data-href'); + if (!$("button").attr('data-href')) { + document.location = $("button").attr('data-href'); } }); }); \ No newline at end of file diff --git a/2-1/script.js b/2-1/script.js index 4d98451..9e63236 100644 --- a/2-1/script.js +++ b/2-1/script.js @@ -9,7 +9,7 @@ $(document).ready(function() { var masterLocation; var search_term = 'devmountain'; function setupApi() { - var masterLocation = 'http://devmounta.in?q='+search_term; + masterLocation = 'http://devmounta.in?q='+search_term; $(document).ajaxError(function(e, xhr, settings, thrown) { console.log("Ajax ERROR", xhr, settings, thrown); }) @@ -17,7 +17,7 @@ $(document).ready(function() { setupApi(); $._get(masterLocation, function(data) { $.each(data.results, function(index, tweet) { - $('#results').append('

'+this.tweet+'

'); + $('#results').append('

'+tweet+'

'); }); }); }); \ No newline at end of file