htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
How to: Get HTML to the left and right of cursor (separately)


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


coling
Novice

Mar 11, 2003, 4:08 PM

Post #1 of 2 (7394 views)
Shortcut
How to: Get HTML to the left and right of cursor (separately) Can't Post

Please excuse me (new here) if this has already been asked:

Is there a way to "get" the HTML to the left, and (separately) to the right of the cursor. ie. with the objective not to edit the contents, but to retrieve the two parts after the user has left-clicked somewhere in the "textarea"?

Looking at editor.js, I would think of creating function(s) similar to editor_getHTML, eg. editor_getLeftHTML and editor_getRightHTML, both of which determine where the cursor is, and return their respective portions.


Benjamin
Staff


Mar 16, 2003, 6:21 PM

Post #2 of 2 (7360 views)
Shortcut
Re: [coling] How to: Get HTML to the left and right of cursor (separately) [In reply to] Can't Post

Hi Coling,

Yes, you can do this by creating a 'range'. Take a look at my code for the link with target popup. In it, I use some code that does almost precisely this.

Hopefully that should point you in the right direction. :-)
Ben
interactivetools.com

 
 
 


Search for (options)