diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html')
| -rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html | 105 |
1 files changed, 0 insertions, 105 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html deleted file mode 100644 index 986154992d..0000000000 --- a/files/zh-cn/web/javascript/reference/global_objects/object/unwatch/index.html +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: Object.prototype.unwatch() -slug: Web/JavaScript/Reference/Global_Objects/Object/unwatch -translation_of: Archive/Web/JavaScript/Object.unwatch ---- -<div>{{JSRef}}</div> - -<div class="warning"> -<p><strong>警告 :</strong> 请尽量避免使用 unwatch() 和 {{jsxref("Object.prototype.watch", "watch()")}} . 这两个方法仅在 Gecko 中实现 , 并且他们过去主要作调试用. 另外, 使用 watchpoints 对性能有一系列的副面影响 ,特别是当使用全局对象,如 <code>window</code>. 你应该使用 <a href="/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters">setters and getters</a> 或 proxies 来替代. 查阅 {{anch("Browser compatibility")}} 以获取更多信息.</p> -</div> - -<p><code><strong>unwatch()</strong></code> 删除一个 {{jsxref("Object.prototype.watch", "watch()")}} 设置的 watchpoint.</p> - -<h2 id="语法">语法</h2> - -<pre class="syntaxbox"><code><var>obj</var>.unwatch(<var>prop</var>)</code></pre> - -<h3 id="参数">参数</h3> - -<dl> - <dt><code>prop</code></dt> - <dd>想要停止监视的对象的属性名</dd> -</dl> - -<h2 id="描述">描述</h2> - -<p>JavaScript调试器具有类似的功能,以及其他调试选项。有关调试器的信息 <a href="/en-US/docs/Venkman">Venkman</a>.</p> - -<p>默认地, 这个方法 被每一个 {{jsxref("Object")}} 的子类继承 </p> - -<div class="note"> -<p><strong>Note:</strong> The reason for <code>unwatch()</code> to take the property name <em>prop</em> as its only parameter is due to the "single handler allowing" behavior of the {{jsxref("Object.watch", "watch()")}} method.</p> -</div> - -<h2 id="例子">例子</h2> - -<p>See {{jsxref("Object.watch", "watch()")}}.</p> - -<h2 id="说明">说明</h2> - -<p>Not part of any specifications. Implemented in JavaScript 1.2.</p> - -<h2 id="浏览器兼容性">浏览器兼容性</h2> - -<div>{{CompatibilityTable}}</div> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{CompatNo}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - <td>{{CompatNo}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Compatibility_notes">Compatibility notes</h2> - -<ul> - <li>从 Firefox 23 ({{bug(903332)}}) 开始, 在 {{domxref("Document")}} 对象上调用 <code>unwatch()</code> 抛出 {{jsxref("TypeError")}} . This regression has been fixed with Firefox 27.</li> -</ul> - -<h2 id="相关链接">相关链接</h2> - -<ul> - <li>{{jsxref("Object.watch()")}}</li> -</ul> |
