source: pyenvjasmine/pyenvjasmine/envjasmine/samples/ajaxDemo.js@ 0:0175515fceea

Last change on this file since 0:0175515fceea was 0:0175515fceea, checked in by Borja Lopez <borja@…>, 9 years ago

Imported sources from http://repos.betabug.ch/pyenvjasmine

File size: 554 bytes
RevLine 
[0]1// This is the contents of ajaxDemo.js, the file to test.
2var TwitterWidget = {
3 makeRequest: function() {
4 var self = this;
5
6 $.ajax({
7 method: "GET",
8 url: "http://api.twitter.com/1/statuses/show/trevmex.json",
9 datatype: "json",
10 success: function (data) {
11 self.addDataToDOM(data);
12 }
13 });
14 },
15
16 addDataToDOM: function(data) {
17 // does something
18 // We will mock this behavior with a spy.
19
20 return data;
21 }
22};
Note: See TracBrowser for help on using the repository browser.