|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hello!
I use an MSHTML-editor in my CMS tool. In that I have an own link tool that takes sel.htmlText and adds <a ...>/</a> as prefix/suffix. But I have a trouble with getting the HTML-code of an image that is selected. If I make a selection by dragging the mouse over the image, like you do on a text, I can use sel.htmlText. But not all people understand that and just click the image. So do you know how I get the HTML-code of Control-objects (got the same problem with tables, hr-lines and other non-textformatting block-elements that you can resize)? So now prove to me that this is a forum with very skilled people worth coming back to! ![]() And please excuse me if my English isn't 100% perfect. I'm from Sweden... ![]() |
|
#2
|
|||
|
|||
|
I took a look at another editor now and got the answer I wanted.
So now I write: Code:
var rng = getRange();
if (getObj().document.selection.type == "Text")
HTML = rng.htmlText;
else if (getObj().document.selection.type == "Control")
{
var ctrlRng = rng.item(0);
HTML = ctrlRng.outerHTML;
}
else
return;
|
|
#3
|
|||
|
|||
|
Mshtml Wysiwyg
So did you get this to work?
I'm actually working on the very same thing! Please let me know. Thanks! |
|
#4
|
|||
|
|||
|
Hello,
I'm just working on the same thing and I also found your solution but unfortunately it only works with MSIE... Do you know how to do the same thing compatible with mozilla & co. browsers ? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > MSHTML WYSIWYG - Get selected image's HTML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|