In one of my posts I tacked about promises from Java Script that Windows 8 introduce. For today I have a challenge for you.
Solution
var bingUrl = new Windows.Foundation.Uri("http://www.bing.com");
Windows.Storage.ApplicationData.current.temporaryFolder.createFileAsync("myFile.txt")
.then(function (myFile) {
var backgroundDownloader = new Windows.Networking.BackgroundTransfer.BackgroundDownloader();
var currentDownload = backgroundDownloader.createDownload(bingUrl, myFile);
currentDownload.startAsync();
})
.then(
function (result) {
return displayOkayStatus(result);
});
...
function displayOkayStatus(result){
return "Complete" + result.toString();
}
The problem is that all the time the displayOkayStatus and result parameter is underfined. Can you identify why?Solution
Comments
Post a Comment