Javascript [Electronic resources] : The Definitive Guide (4th Edition) نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Javascript [Electronic resources] : The Definitive Guide (4th Edition) - نسخه متنی

David Flanagan

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


Availability


DOM Level 2 Range


Synopsis

void insertNode(NodenewNode)
throws RangeException,
DOMException;

Arguments


newNode

The node to be inserted into the document.


Throws


This method throws a RangeException with a code of
INVALID_NODE_TYPE_ERR if
newNode is an Attr, Document, Entity, or Notation
node.

This method also throws a DOMException with one of the following
code values under the following conditions:

HIERARCHY_REQUEST_ERR

The node that contains the start of the range does not allow
children, or it does not allow children of the specified type, or
newNode is an ancestor of that node.

NO_MODIFICATION_ALLOWED_ERR

The node that contains the start of the range, or any of its
ancestors, is read-only.

WRONG_DOCUMENT_ERR

newNode is part of a different document than the
range is.


Description


This method inserts the specified node (and all its descendants) into
the document at the start position of this range. When this method
returns, this range includes the newly inserted node. If
newNode is already part of the document,
it is removed from its current position and then reinserted at the
start of the range. If newNode is a
DocumentFragment node, it is not inserted itself, but all of its
children are inserted, in order, at the start of the range.

If the node that contains the start of the range is a Text node, it
is split into two adjacent nodes before the insertion takes place. If
newNode is a Text node, it is not merged
with any adjacent Text nodes after it is inserted. To merge adjacent
nodes, call Node.normalize( ).


See Also


DocumentFragment, Node.normalize( )

/ 844