visual studio 2012 - (Windows 8 Javascript) WinJS.xhr does not reflect changes from api -
i developing app, access photos slr via wifi-sd-card. right now, trying retrieve html response particular location on camera , retrieve images' file names. went okay, retrieving html response; however, not update. receiving same response on , on again (even if delete or take new photos).
been stuck problem days now. hope me out. here's code:
function retrieveimgfilenames() { var url = "http://my-sd-card-host:port/path"; winjs.xhr({ url: url, responsetype: "text" }) .done(function (r) { var doc = document.createelement("html"); doc.innerhtml = r.response; var links = doc.getelementsbytagname("a") var imgs = []; var imgcount = 0; var notimg = []; (var = 0; < links.length; i++) { var filename = links[i].getattribute("href"); if (filename.substring(filename.length - 3, filename.length) == 'jpg') { imgs.push(filename); imgcount++; } else { notimg.push(filename); } } }, function (r) { document.getelementbyid("msg").innerhtml = "sorry. :( error: " + r.statustext; }); }
you can try , add if-modified-since
header low value thu, 01 jan 1970 00:00:00 gmt
.
refer http://msdn.microsoft.com/en-us/library/windows/apps/hh868281.aspx
Comments
Post a Comment