Hello,
Is there a way to know that the user is closing the navigator, and/or the tab in Safari for iPhone, so that I can save data to localStorage, or do I need to do it for every input ?
Hello,
Is there a way to know that the user is closing the navigator, and/or the tab in Safari for iPhone, so that I can save data to localStorage, or do I need to do it for every input ?
Okay, it seems like onbeforeunload is a Microsoft invention, and so is not supported by Safari nor Opera.
I'm going to have to look for another way :)
Having looked at the documentation for localStorage, I think you need to be storing the relevant data as it's generated/modified rather than waiting for a close event. I realise this is probably more work than any of us would like but at least you can be sure that you are saving the current state at each point so that even a browser crash shouldn't kill your state.