How does the cursor blink in a jQuery text editor?

I'm just trying to find out how a text editor (jquery) works, I found a lot of jQuery text editors on the Internet. My question is: the editor itself is not a text area, but an iframe, I think, but how cursonr blinks like a cursor in a text area

please check http://batiste.dosimple.ch/blog/posts/2007-09-11-1/rich-text-editor-jquery.html

If you have a URL to create a text editor, let me know

+4
source share
2 answers

It seems to switch the designMode property to a document object and set it to "On" with this function:

function tryEnableDesignMode(iframe, doc, callback) { try { iframe.contentWindow.document.open(); iframe.contentWindow.document.write(doc); iframe.contentWindow.document.close(); } catch(error) { console.log(error) } if (document.contentEditable) { iframe.contentWindow.document.designMode = "On"; callback(); return true; } else if (document.designMode != null) { try { iframe.contentWindow.document.designMode = "on"; callback(); return true; } catch (error) { console.log(error) } } setTimeout(function(){tryEnableDesignMode(iframe, doc, callback)}, 250); return false; } 
+1
source

What you mean is usually called WYSIWYG.

The basis of creating WYSIWYG is to have an iframe with the property designMode = true. Basically, you can have the appearance of a text field, but with additional features.

For more information, you can look at this tutorial:
- http://www.emirplicanic.com/javascript/cross-browser-textarea-editor.php
- https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla
- http://msdn.microsoft.com/en-us/library/ms537834(VS.85).aspx

Or do a Google search using the keyword "WYSIWYG javascript tutorial".

Related answers
- javascript Rich Text Editors

+1
source

All Articles