Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Clearing Local Storage on Page Load

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!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Clearing Local Storage on Page Load

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?

Chris Flowers6766842
Posts: 0
Joined: Thu Mar 27, 2014 8:26 pm

Clearing Local Storage on Page Load

Thanks! That seems to have solved it.

Return to “Issues”