From b9afb23d12dcae1e09f8d04c72143c5ddaa34aea Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Fri, 16 Jul 2021 16:27:00 -0400 Subject: delete conflicting/orphaned docs (zh-CN) (#1412) * delete conflicting docs (zh-CN) * and redirects * do orphaned as well * fix * remove more orphans * revert orphaned docs that can identify origin * move orphaned docs to current loc * adjust slug path * fix redirect change from rebase Co-authored-by: Irvin --- .../orphaned/web/api/node/setuserdata/index.html | 104 --------------------- 1 file changed, 104 deletions(-) delete mode 100644 files/zh-cn/orphaned/web/api/node/setuserdata/index.html (limited to 'files/zh-cn/orphaned/web/api/node/setuserdata') diff --git a/files/zh-cn/orphaned/web/api/node/setuserdata/index.html b/files/zh-cn/orphaned/web/api/node/setuserdata/index.html deleted file mode 100644 index 361bfcca25..0000000000 --- a/files/zh-cn/orphaned/web/api/node/setuserdata/index.html +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: Node.setUserData() -slug: orphaned/Web/API/Node/setUserData -translation_of: Web/API/Node/setUserData -original_slug: Web/API/Node/setUserData ---- -

{{ APIRef }}{{ obsolete_header() }}

-

The Node.setUserData() method allows a user to attach (or remove) data to an element, without needing to modify the DOM. Note that such data will not be preserved when imported via {{domxref("Node.importNode")}}, as with {{domxref("Node.cloneNode()")}} and {{domxref("Node.renameNode()")}} operations (though {{domxref("Node.adoptNode")}} does preserve the information), and equality tests in {{domxref("Node.isEqualNode()")}} do not consider user data in making the assessment.

-

This method offers the convenience of associating data with specific nodes without needing to alter the structure of a document and in a standard fashion, but it also means that extra steps may need to be taken if one wishes to serialize the information or include the information upon clone, import, or rename operations.

-
-

The Node.getUserData and {{domxref("Node.setUserData")}} methods are no longer available from Web content. {{domxref("Element.dataset")}} or WeakMap can be used instead.

-
-

Syntax

-
prevUserData = someNode.setUserData(userKey, userData, handler);
-

Parameters

- -

Example

-
var d = document.implementation.createDocument('', 'test', null);
-d.documentElement.setUserData('key', 15, {handle:function (o, k, d, s, ds) {alert(o+'::'+k+'::'+d+'::'+s+'::'+ds)}}); // 2::key::15::[object Element]::[object Element]
-alert(d.documentElement.getUserData('key')); // 15
-var e = document.importNode(d.documentElement, true); // causes handler to be called
-alert(e.getUserData('key')); // null since user data is not copied
-
-

Specifications

- - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('DOM WHATWG', '#interface-node', 'Node')}}{{Spec2('DOM WHATWG')}}Removed from the specification.
{{SpecName('DOM3 Core', 'core.html#Node3-setUserData', 'Node.setUserData()')}}{{Spec2('DOM3 Core')}}Initial definition.
-

Browser compatibility

-

{{CompatibilityTable}}

-
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatNo}}Supported from {{CompatGeckoDesktop("1.0")}} to {{CompatGeckoDesktop("21.0")}}.
- Removed in {{CompatGeckoDesktop("22.0")}} [1]
{{CompatUnknown}}{{CompatNo}}{{CompatNo}}
-
-
- - - - - - - - - - - - - - - - - - - -
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}Supported from {{CompatGeckoMobile("1.0")}} to {{CompatGeckoMobile("21.0")}}.
- Removed in {{CompatGeckoMobile("22.0")}} [1]
{{CompatVersionUnknown}}{{CompatNo}}{{CompatNo}}
-
-

[1] The method is still available from chrome scripts.

-

See also

- -- cgit v1.2.3-54-g00ecf