Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving HTML data into localstorage? #27

Open
samjco opened this issue Sep 13, 2019 · 0 comments
Open

Saving HTML data into localstorage? #27

samjco opened this issue Sep 13, 2019 · 0 comments

Comments

@samjco
Copy link

samjco commented Sep 13, 2019

    $('#btnSaveFormHTML').click(function() {
      var textToWrite = $('form#posts-filter').html();
      var textToWriteWrap = '<form id="posts-filter" method="get">'+textToWrite+'</form>';
      var textToWriteClean = textToWriteWrap.replace(/>[\n\t ]+</g, "><"); //minify
      var textFileAsBlob = new Blob([textToWriteClean], { type: 'text/html' }); //Do I need Blob?

       //..... LocalStorage code here??

   });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant