1
WorkerScript.onMessage = function(message) {
3
var XHR = new XMLHttpRequest();
7
XHR.open("GET", message.url);
8
XHR.setRequestHeader("Accept", "application/json");
10
XHR.onreadystatechange = function() {
11
if(XHR.readyState != XHR.DONE)
16
var obj = JSON.parse(XHR.responseText);
18
for(var i=0; i<obj.results.length; i++) {
20
if (obj.results[i].poster_path == null)
23
thumb_url = "http://d3gtl9l2a4fn1j.cloudfront.net/t/p/" + "w185/" + obj.results[i].poster_path
25
message.model.append({"name": obj.results[i].title,
26
"thumb_url": thumb_url,
27
"id": obj.results[i].id});