The following is a sample code using which you can develop a good understanding on how to implement the promises in WT effectively. Follow these steps:
Create a blank Windows Runtime app named
IamPromise
.Add an
input
element.Add a
div
element that displays the result for the URL.Add styling instructions to
default.css
to add some presentation in the app.Add a change handler for the
input
element.In the change handler, call
xhr
.Build and debug the app, and then enter a URL.
Create a WT app in JS in VS2013.
Add an
input
element.Within HTML, create an
input
element using the following code:<div> <input id="inputUrl" /> <!—the input id above is called input URL -- > </div> Add a DIV element that displays the result for the URL. <div id="ResultDiv">Result</div> <!—the div id named here as ResultDiv -- > Add the styling instructions to "default.css". input { // add your style statements here }