-
Book Overview & Buying
-
Table Of Contents
Developing Windows Store Apps with HTML5 and JavaScript
By :
The Windows library for JavaScript binding (WinJS.Binding) provides a mechanism to bind data and styles to the HTML elements. The binding provided by the Windows library for JavaScript is one-way by default, so the HTML elements are updated when the data changes; however, any change in the HTML elements does not reflect on the data being bound to. Let's see this in action, and we'll start with the very basic kind of binding; that is, a declarative binding between an HTML element and a simple JavaScript object that contains only data.
First we will check for the WinJS.Binding.optimizeBindingReferences property, and set it to true if not set already.
It is important to always set the WinJS.Binding.optimizeBindingReferences property to true while performing a declarative binding. This property determines whether or not the binding should automatically set the ID of an element. This property should be set to true in apps that use WinJS.Binding.
We'll create a sample person JavaScript...
Change the font size
Change margin width
Change background colour