通过ajax post将div Html和Css保存在数据库中。

I am try to make save option for editable dives And also i am using Ckeditor for editing.I am searching on google many times but i did find any simple and authentic example.Actully i need when user done editing via Ckeditor than div content css and html save in Database.Is that possible.

For example i have some example content.look at below.

Html

<div id="editor" contentEditable='true'; ><i>Company</i><br><b>Bigbang</b>
<div><img src="simple.png"></div>
</div>

<button>Save</button>

Css

#editor i {width:200px;border:1px solid #fff;}

you can use jQuery Ajax

<div id="editor" contentEditable='true'; ><i>Company</i><br><b>Bigbang</b>
<div><img src="simple.png"></div>
</div>

<button id="btnSave">Save</button>

$.ajax({
     url: yourUrl,
     type:"POST",
     data: $("#editor").html();
     success:function(data){alert(data);}
});