RE: Selected string in WebView
RE: Selected string in WebView
- Subject: RE: Selected string in WebView
- From: "Christopher Hickman" <email@hidden>
- Date: Tue, 23 May 2006 10:34:13 -0400
> Hi!
> Is there a method to get the selected text inside a WebView.
> I've found
>
> [[myWebView selectedDOMRange] markupString];
>
> but it return the complete page range html source. I would
> only the text.
Does -[DOMRange toString] give you what you want?
There's little to no documentation to explain the interface of the DOM
classes, but take a look at the header to see the messages you can send a
DOMRange object here:
http://www.opensource.apple.com/darwinsource/Current/WebCore-417.24/kwq/DOMR
ange.h
Note that there are some un-Cocoa-like names for some of these methods,
since it is just a wrapper for the W3C DOM IDL (as explained here:
http://developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/
Tasks/DOMObjCBindings.html).
Topher
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden