Hi everyone,
I am developing my own CMS. I replaced the standard hyperlink dialog with my own, so, now my program is responsible for reading the href property. I am using IFRAME tag as an editing area and switching it to design mode by designMode property to true. I was trying to write my own code read href:
but it doesn't work. (the is written in JS of course)
I'd appreciate any help.
Thanks a lot!
I am developing my own CMS. I replaced the standard hyperlink dialog with my own, so, now my program is responsible for reading the href property. I am using IFRAME tag as an editing area and switching it to design mode by designMode property to true. I was trying to write my own code read href:
PHP Code:
function hyperlink()
{
editor.focus();
if (editor.document.queryCommandEnabled('createlink'))
{
var ctrl = editor.document.selection.createRange();
while ((ctrl.tagName != 'BODY') && (ctrl.tagName != 'A'))
{
ctrl = ctrl.parentElement();
}
var result = showModalDialog("link.php", ctrl.href, "resizable: no; help: no; status: no; scroll: no; dialogWidth: 328px; dialogHeight: 175px;");
if (result)
{
editor.document.execCommand ('createlink', false, result['url']);
}
}
}
I'd appreciate any help.
Thanks a lot!
Comment