if (localStorage.getItem("CalendarFeedFlights") == null){
var data = {
"CalendarFeedFlights": "http:\/\/www.focusdashboard.com\/feeds\/calendars\/3ca79d41-e71f-4c4d-9e16-d7ea40e50b69-flights.ics",
"CalendarFeedFull": "http:\/\/www.focusdashboard.com\/feeds\/calendars\/3ca79d41-e71f-4c4d-9e16-d7ea40e50b69.ics",
"CalendarFeedTrips": "http:\/\/www.focusdashboard.com\/feeds\/calendars\/3ca79d41-e71f-4c4d-9e16-d7ea40e50b69-trips.ics",
"EmailAlerts": [{
"AlertName": "emailalertaddhotel",
"AlertText": "A hotel has been added to the booking",
"SavedValue": false
}, {
"AlertName": "emailalertaddcar",
"AlertText": "A car has been added to the booking",
"SavedValue": false
}, {
"AlertName": "emailalertxxlhotel",
"AlertText": "A hotel has been removed from the booking",
"SavedValue": true
}, {
"AlertName": "emailalertxxlcar",
"AlertText": "A car has been removed from the booking",
"SavedValue": true
}, {
"AlertName": "emailalertretfltreminder",
"AlertText": "Reminder for Return Flight",
"SavedValue": false
}, {
"AlertName": "emailalertcheckinreminder",
"AlertText": "Reminder for flight check in",
"SavedValue": true
}],
"GUID": "3ca79d41-e71f-4c4d-9e16-d7ea40e50b69",
"NumberBookingsToShow": 5
}
}
// This would be in the Ajax Success var data = JSON.stringify(response)
localStorage.setItem("userSettings", JSON.stringify(data));
var myFeeds = localStorage.getItem("userSettings");//Retrieve the stored data set when user logged in
myFeeds = JSON.parse(myFeeds); //Converts string to object
if(myFeeds == null) //If there is no data, initialize an empty array
myFeeds = [];
var cal1=myFeeds["CalendarFeedFlights"];
var cal2=myFeeds["CalendarFeedFull"];
var cal3=myFeeds["CalendarFeedTrips"];
var guid=myFeeds["GUID"];
var...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.