资源说明:JavaScript Range/Selection implementation for Internet Explorer
RangeIE ======= JavaScript Range/Selection implementation for Internet Explorer * *Author: Brendon Crawford* * *Homepage: https://github.com/last/rangeie/* * *Sponsored By: [Last.vc](http://last.vc)* Relevant Links -------------- * [Mozilla Range documentation](https://developer.mozilla.org/en/DOM/range) * [Mozilla Selection documentation](https://developer.mozilla.org/en/DOM/Selection) * [W3C DOM Range documentation](http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html) Background ---------- Before IE9, IE only supports what is known as a TextRange object, but it does not support the W3C DOM Range object nor does it support the Mozilla Selection object. As a result, implementing cross-browser JavaScript applications for manipulating and managing text ranges/selections can be quite difficult. RangeIE is not a 100% implementation of Range/Selection, but it does cover most concepts. Caveats ------- RangeIE was originally intended to work with contenteditable divs containing text, spans, and anchor elements. It has not been developed to work with designmode documents, iframes, or contenteditable elements containing images or block-level elements such as divs and lists. Your script must call *ELM.focus()* before making any use of RangeIE, where ELM is your contenteditable element, typically a div. RangeIE so far has only been tested on IE8, and will not be necessary for use in IE9. When using *Range.selectNode(referenceNode)* and *Range.selectNodeContents(referenceNode)*, *referenceNode* must be an instance of a node which has been added to the document, via *insertBefore*, *appendChild*, etc. If this is not the case, you will get an "invalid argument" error. Example Usage -------------Hello World Foo Bar Foo Baz
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。