www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home Resources API Reference Mojo.Model.Cookie.get()

Mojo.Model.Cookie.get()

Returns the object stored in the cookie, or undefined if the cookie does not exist.

Example usage:

//Get preferences cookie, or create it 
this.cookie = new Mojo.Model.Cookie("NewsPrefs"); 
var oldNewsPrefs = this.cookie.get(); 
if (oldNewsPrefs) { 
    if (oldNewsPrefs.newsVersionString == "1.0"){ 
            featureIndexFeed = oldNewsPrefs.featureIndexFeed; 
            featureFeedEnable = oldNewsPrefs.featureFeedEnable; 
            featureStoryInterval = oldNewsPrefs.featureStoryInterval; 
            feedUpdateInterval = oldNewsPrefs.feedUpdateInterval; 
            updateDialog = oldNewsPrefs.updateDialog; 
     } else { 
            this.cookie.put(){ 
               featureIndexFeed: featureIndexFeed, 
               featureFeedEnable: featureFeedEnable, 
               feedUpdateInterval: feedUpdateInterval, 
               featureStoryInterval: featureStoryInterval, 
               newsVersionString: newsVersionString 
            } 
    } 
} 
 

0 Comments

    Add Comment


      • >:o
      • :-[
      • :'(
      • :-(
      • :-D
      • :-*
      • :-)
      • :P
      • :\
      • 8-)
      • ;-)