| Topic | Testing if a property of an object is undefined |
| Output | sample code |
| Step | Description |
| 1 |
if (SessionJSON.Result == undefined) { SessionJSON.Result = null;}
|
| Topic | Testing if a property of an object is undefined |
| Output | sample code |
| Step | Description |
| 1 |
if (SessionJSON.Result == undefined) { SessionJSON.Result = null;}
|
| Topic | Assynchronous functions in javascript for Metro Application |
| Output | A sample pair of functions |
| Step | Description |
| 1 | Create the assynchronous function that you will call later
function assynchrone_function() {
return new WinJS.Promise(function (Jsonoutput) {
var entrainementJSON;
...
do the assync stuff here
...
Jsonoutput(entrainementJSON);
})
}
|
| 2 | Call your function, waiting that it's done before using the return
var promise = assynchrone_function();
promise.then(function (data) {
...
use the data
...
});
|