i have come across many many open source WYSISWYG html editors and one thing that kept me always annoying is a popup html window to create a link. Since creating the hyperlink is such an important feature in the wysiwyg editor, keeping it simple is so important.
I just wanted like a prompt asking for URL and then creating a link. No more popup windows. I have searched a lot in the web for such a simple javascript code and its very simple.
function doURL() {
var mylink = prompt("Enter a URL:", "http://");
if ((mylink != null) && (mylink != "")) {
document.getElementById('rte').contentWindow.document.execCommand("CreateLink",false,mylink);
}
}
Similar Posts:
- A Simple WYSIWYG Editor in Javascript
- how to change div content in javascript?
- how to get selected textarea value using javascript
- Fast loading and lightweight WYSIWYG html Editors for PHP
- how to call a php script from javascript?
- Fix -> Bootmgr is missing in Windows 7 on startup
- Lightweight PHP WYSIWYG HTML Editor
- iframe innerHTML value from textarea
- Free Markup BBCode Editor in Javascript
- Free Markup TextArea HTML Editor in Javascript


February 11, 2011
I will know, I thank for the help in this question.