Skip to content

Instantly share code, notes, and snippets.

@SidneyAllen
Created December 14, 2011 16:51
Show Gist options
  • Save SidneyAllen/1477400 to your computer and use it in GitHub Desktop.
Save SidneyAllen/1477400 to your computer and use it in GitHub Desktop.
jqm-cf-subscribe-02
var profile = $.parseJSON(localStorage.getItem('123'));
// 3rd State
if(profile !== null) {
...
} else {
// 1st state
// NO PROFILE, and NOT REDIRECTING from PAYPAL
if(ec['url']['token'] === undefined)
{
$('#paidContent').html('To access our premium content, please subscribe for only ' +
'$19.99 a year.<a href="#" id="subscribe" data-role="button">Subscribe ' +
'via PayPal</a>');
$('#paid').page('destroy').page();
$.mobile.hidePageLoadingMsg();
// 2nd state
// REDIRECTING FROM PAYPAL GET DETAILS
} else {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment