Page 1 of 1

Clearing Local Storage on Page Load

Posted: Mon Oct 06, 2014 12:39 pm
by Chris Flowers6766842

Hello

Is this possible please?

Basically I have an app which is essentially a form, and on pressing the submit button sends an email (SendGrid) with information pulled from local storage.

If however, I load the app up again and was to enter no new information in the components and clicked submit again, it simply pulls the information from local storage entered previously.

I would like to be able to clear the local storage once the page which appears after clicking submit has loaded.

I saw this code in the knowledge base:

// clear storage
function clear () {
localStorage.clear();
}

I added it to a page load event but it doesn't seem to work.

Any suggestions please?

Thank you!


Clearing Local Storage on Page Load

Posted: Mon Oct 06, 2014 12:57 pm
by Evgene Karachevtsev

Hello Chris,

Could you please specify, do you call this added function?
Could you please try to execute prelocalStorage.clear(); /pre without the wrapper in function?
Also please detail, is local storage become clear it or not?


Clearing Local Storage on Page Load

Posted: Mon Oct 06, 2014 1:06 pm
by Chris Flowers6766842

Thanks! That seems to have solved it.