Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 81873 of DOMUserData

  • Revision slug: DOM/DOMUserData
  • Revision title: DOMUserData
  • Revision id: 81873
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment one or more formatting changes

Revision Content

{{ DOMRef() }}

Summary

DOMUserData refers to application data. In JavaScript, it maps directly to Object. It is returned or used as an argument by Node.setUserData(), Node.getUserData(), used as the third argument to handle() on UserDataHandler, and is used or returned by various DOMConfiguration methods.

Note that although it can be an object, in Mozilla, it may be returned as a string or other type, if it was set as such a type (e.g., Node.setUserData() and Node.getUserData()).

Persistence

DOMUserData is not persisted nor serialized and will not be present after the application has restarted or after a crash. If you are interested in persisting data you might rather need to use {{ interface("nsISessionStore") }}.

Specification

See also

Revision Source

<p>{{ DOMRef() }}</p>
<h3>Summary</h3>
<p><code>DOMUserData</code> refers to application data. In JavaScript, it maps directly to <code><a href="/en/JavaScript/Reference/Global_Objects/Object" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></code>. It is returned or used as an argument by <code><a class="internal" href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">Node.setUserData</a>()</code>, <code><a class="internal" href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">Node.getUserData</a>()</code>, used as the third argument to <code>handle()</code> on <a class="internal" href="/En/DOM/UserDataHandler" title="En/DOM/UserDataHandler"><code>UserDataHandler</code></a>, and is used or returned by various <a class="internal" href="/En/DOM/DOMConfiguration" title="En/DOM/DOMConfiguration"><code>DOMConfiguration</code></a> methods.</p>
<p>Note that although it can be an object, in Mozilla, it may be returned as a string or other type, if it was set as such a type (e.g., <code><a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData">Node.setUserData</a>()</code> and <code><a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData">Node.getUserData</a>()</code>).</p>
<h3>Persistence</h3>
<p><code>DOMUserData</code> is not persisted nor serialized and will not be present after the application has restarted or after a crash. If you are interested in persisting data you might rather need to use {{ interface("nsISessionStore") }}.</p>
<h3>Specification</h3>
<ul> <li><a class=" external" href="https://www.w3.org/TR/DOM-Level-3-Core/core.html#DOMUserData">DOM Level 3 Core: DOMUserData</a></li>
</ul>
<h3>See also</h3>
<ul> <li><a href="/En/DOM/UserDataHandler" title="En/DOM/UserDataHandler"><code>UserDataHandler</code></a></li> <li><a href="/En/DOM/Node.getUserData" title="En/DOM/Node.getUserData"><code>node.getUserData</code></a>, <a href="/En/DOM/Node.setUserData" title="En/DOM/Node.setUserData"><code>node.setUserData</code></a></li>
</ul>
Revert to this revision