src/js/data.js
branchpopcorn-port
changeset 452 35495f156c41
parent 291 e942a49240f4
child 453 8568e47379a2
equal deleted inserted replaced
451:2217bd6fd068 452:35495f156c41
    33                   for (i = 0; i < this._callbacks[base_url].length; i++) {
    33                   for (i = 0; i < this._callbacks[base_url].length; i++) {
    34                     this._callbacks[base_url][i](this._cache[base_url]);                                  
    34                     this._callbacks[base_url][i](this._cache[base_url]);                                  
    35                   }
    35                   }
    36       };
    36       };
    37       
    37       
    38       IriSP.jQuery.get(url, IriSP.wrap(this, func));                                
    38       /* automagically choose between json and jsonp */
       
    39       if (url.indexOf(document.location.hostname) === -1 &&
       
    40           url[0] !== '/' /* not a relative url */ ) {
       
    41         // we contacting a foreign domain, use JSONP
       
    42 
       
    43         IriSP.jQuery.get(url, {}, IriSP.wrap(this, func), "jsonp");
       
    44       } else {
       
    45 
       
    46         // otherwise, hey, whatever rows your boat
       
    47         IriSP.jQuery.get(url, IriSP.wrap(this, func));
       
    48       }
    39     
    49     
    40     } else {
    50     } else {
    41       /* simply push the callback - it'll get called when the ressource
    51       /* simply push the callback - it'll get called when the ressource
    42          has been received */
    52          has been received */
    43       
    53