• Advertisement
Sign in to follow this  

[web] Empty Selection/Range object in Opera

This topic is 3469 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

For certain reasons, I need to know the index of an empty selection of an html element, I can do this fine in firefox and ie, however, Opera always reports the begin and end index of the selection as 0 if the selection is empty. Does anyone know of a way around this?

Share this post


Link to post
Share on other sites
Advertisement
Check your call to window.getSelection().rangeCount. It seems Opera denies the existence of empty selections and returns 0 for window.getSelection().rangeCount. My solution: Ditch support for Opera until they support standards for 100%, not 99%.

Share this post


Link to post
Share on other sites
Quote:
Original post by kanzler
Check your call to window.getSelection().rangeCount. It seems Opera denies the existence of empty selections and returns 0 for window.getSelection().rangeCount. My solution: Ditch support for Opera until they support standards for 100%, not 99%.

I might do this, but I'd rather not. Mainly because I use Opera as my primary browser. Any other suggestions?

I was thinking maybe I could find the index of the selection based on the pixel cooridnates of the mouse, but I'm not really sure how to go about implementing it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement