473,320 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

document.selection.createRange();

Is there a NS7, Opera7 or Mozilla equivalent for:

document.selection.createRange();

Jeff
Jul 20 '05 #1
1 11813


Jeff Thies wrote:
Is there a NS7, Opera7 or Mozilla equivalent for:

document.selection.createRange();


For Mozilla if you want to manipulate the selection in a text control see
http://www.faqts.com/knowledge_base/.../13562/fid/130

If you want to manipulate the selection within text elements then
Mozilla offers the method

var selection = window.getSelection();
if (selection.rangeCount) {
var range = selection.getRangeAt(0);
}

That range object is a W3C DOM Level 2 Range object, see
http://www.w3.org/TR/DOM-Level-2-Tra...el-2-Range-idl

However the nicest methods surroundContents and insertNode are still
buggy with Mozilla as far as I know.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin Karlsson | last post by:
Hi guys, Does anyone know how I can restore a selection created with createRange()? The problem is that I have a function that opens a new window with window.open() which of course makes the...
8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
1
by: lawrence | last post by:
This PHP function prints out a bunch of Javascript (as you can see). This is all part of the open source weblog software of PDS (www.publicdomainsoftware.org). We had this javascript stuff...
4
by: JE | last post by:
Hi! I am snooping around all sorts of websites and faqs, in search of a way to pick up any selected (mouse-highlighted) text in a HTML page, and store it in a JavaScript variable. I have...
5
by: George Hester | last post by:
function spawn(ev){ var oSelect = ''; var oFlag = false; if (ns4 || ns6) oSelect = document.getSelection(); else if (ie4 || ie5){ if (!ev) ev = window.event; oFlag = true; oSelect =...
15
by: lawrence | last post by:
Is this the correct way to test for a method before I use it? createRange() is, I believe, an IE only method. function wrapSelectionInTag(selection, tag) { if (document.selection.createRange)...
1
by: c.anandkumar | last post by:
Hi How do I figure out if a selection in a document is in a particular control? I have a TEXTAREA in which a user can type in some text, select some text and 'apply' tags around it clicking a...
1
by: mikeg | last post by:
there are 2 divisions. there is a word-document loaded in first division. when the user clicks somewhere in the document, i need some event to return to me something that is a valid...
2
by: ethandbrown | last post by:
Hi All-- I'm a bit stymied here. I need to display arbitrary HTML obtained through AJAX. The problem is when a <script> block is encountered one can't use innerHTML to set the content, because...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.