3 ms·
You could build a nicer WYSIWYG Wiki interface with one line: contenteditable="on" without any libraries. Here's my take. WYSIWYG, AJAX, and no libraries in tw
by antimatter15 16y ago
You could build a nicer WYSIWYG Wiki interface with one line: contenteditable="on" without any libraries.
Here's my take. WYSIWYG, AJAX, and no libraries in two lines:
<iframe src="javascript:unescape('%3Cbody%20contentEditable%3E')" style="width: 500px; height: 500px"></iframe>
<button onclick="var x=new XMLHttpRequest;x.open('POST','/update',1);x.setRequestHeader('Content-type','application/x-www-form-urlencoded');x.send(frames[0].innerHTML)">Save</button>
On JSBin: http://jsbin.com/ebiju3 http://jsbin.com/ebiju3 (don't try saving, there's no server part here!)
- jasonkester 16y agoHave you actually tried using ContentEditable in a production system? If so, I think you'd withdraw your comment. It's hairball.