$30 off During Our Annual Pro Sale. View Details »

Firefox OS勉強会 4th Untitled

Avatar for masawada masawada
October 16, 2013

Firefox OS勉強会 4th Untitled

Avatar for masawada

masawada

October 16, 2013
Tweet

More Decks by masawada

Other Decks in Technology

Transcript

  1. // XHR var xhr = new XMLHttpRequest({mozSystem: true}); // manifest.webapp

    "type": "privileged", "permissions": { “systemXHR”: {} }
  2. var xhr = new XMLHttpRequest({mozSystem: true}); // தུ xhr.onreadystatechange =

    function(){ if(xhr.readyState === 3){ this.onloading(xhr); }else if(xhr.readyState === 4){ if(xhr.status === 200){ this.onsuccess(xhr); }else{ this.onerror(xhr); } } }.bind(this);
  3. var con = Violet.HTTPClient({ method: method, uri: uri }); con.onloading

    = function(xhr){ var lines = xhr.responseText.split('\r\n'); if(!lines[lines.length-2]){ return false; } callback(JSON.parse(lines[lines.length-2])); };