HTML and CSS Reference
In-Depth Information
As you can see from the code, the unescape method is used to escape the
characters used for each of the favorites properties. This is because the add
method escapes each property value so that the object can be stored in local
storage.
The next step is to create a movies view from the array of movies.
var app = app || {};
app.controller = app.controller || {};
app.controller.favorites = function(){
...
this.list = function(){
...
/**
* Create a new movielist view with the _movies model
*/
var view = new app.view.movielist(_movies);
// Set the contents of the search results div
_favoriteslist.innerHTML = '';
// Append the view to the favorites list
_favoriteslist.appendChild(view.render());
...
}
...
}
Finally, you will need to create a new iScroll object for the view and show it. This
will allow users on devices older than Honeycomb to be able to scroll for long
lists.
var app = app || {};
app.controller = app.controller || {};
app.controller.favorites = function(){
...
this.list = function(){
...
// Destroy the listScroll if it exists
if(_listScroll !== null){
_listScroll.destroy();
_listScroll = null;
 
Search WWH ::




Custom Search