JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old August 18th, 2003, 07:19 AM
Allram Allram is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 Allram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Allram
Exclamation MSHTML WYSIWYG - Get selected image's HTML

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...

Reply With Quote
  #2  
Old August 18th, 2003, 07:48 AM
Allram Allram is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 2 Allram User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Allram
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;

Reply With Quote
  #3  
Old May 2nd, 2004, 02:10 PM
pmason44m pmason44m is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 1 pmason44m User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Mshtml Wysiwyg

So did you get this to work?
I'm actually working on the very same thing!

Please let me know.
Thanks!

Reply With Quote
  #4  
Old October 22nd, 2004, 07:31 AM
goldrake73 goldrake73 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 7 goldrake73 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 18 m 30 sec
Reputation Power: 0
Unhappy Do you know how to do the same with mozilla & co. ?

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 ?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > MSHTML WYSIWYG - Get selected image's HTML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway