0

I am looking for a simple example to save content from a contentEditable div without using php. I can't use php because I am using it in Google Docs. I would prefer an example with innerHTML.

3
  • 1
    and i am looking for a piece of code, in your POST Commented Mar 20, 2015 at 10:47
  • It depends what you are trying to save it to, as to whether this is possible or not. You need to do a bit more research, give it a go and then come back with a more specific question as in its current format, your question is way to broad and not on topic for his site Commented Mar 20, 2015 at 11:14
  • Some people seem to actually understand what I mean though :) here is your code Commented Mar 26, 2015 at 9:15

1 Answer 1

1

If you don't want to use PHP or any Server Side Script then you can use only cookies or localStorage like

$('div.contentEditable').on('keyup',function(){
    localStorage.setItem('content',$(this).html());
});

And get the localstorage item like,

localStorage.getItem('content');// if content is previously set

And if you can use Server side script then use $.ajax() to store it in database and use it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.