Blame view

framework/thirdparty/jasmine-ajax/examples/jquery/public/javascripts/TwitSearch.js 829 Bytes
e4e4ce76   Administrator   update rep
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  var TwitSearch = function(){
  
    return {
      displayResults: function(tweets){
        var updateStr = "";
  
        $(tweets).each(function(index, tweet) {
          updateStr += "<li><img src='" + tweet.imageUrl + "' alt='" + tweet.user + " profile image' />" +
                        "<p>" + tweet.text + "</p>" +
                        "<p class='user'>" + tweet.user + "</p>" +
                        "<p class='timestamp'>" + tweet.postedAt + "</p>";
  
        });
  
        $("#results").html(updateStr);
      },
  
      searchFailure: function(response){
        $("#results").html("<h2>Oops. Something went wrong.</h2>");
      },
  
      cleanup: function(){},
  
      rateLimitReached: function(){
        console.log("rate limited");
      },
  
      failWhale: function(){
        $("#results").html("<img src='images/fail-whale.png' />");
      }
    }
  }();