Ignore:
Timestamp:
Apr 24, 2015, 1:03:31 PM (9 years ago)
Author:
Borja Lopez <borja@…>
Branch:
default
Phase:
public
Message:

Imported latest envjasmine version, the initial import from darcs had the wrong version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyenvjasmine/envjasmine/samples/ajaxDemo.js

    r0 r19  
    11// This is the contents of ajaxDemo.js, the file to test.
    2 var 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     },
    152
    16     addDataToDOM: function(data) {
    17         // does something
    18         // We will mock this behavior with a spy.
    19        
    20         return data;
    21     }
     3if (typeof(NS) === 'undefined' || !NS) {
     4    var NS = {};
     5}
     6
     7NS.greeter = function (name) {
     8    return 'Hello ' + name + '!';
    229};
     10
     11NS.greetUser = function (id) {
     12    return $.ajax({
     13        data: id,
     14        url: 'name.html',
     15        success: function (data) {
     16            NS.greeter(data.name);
     17        }
     18    });
     19};
     20
     21
Note: See TracChangeset for help on using the changeset viewer.