diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html b/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html new file mode 100644 index 0000000000..e823c314a8 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/object/eval/index.html @@ -0,0 +1,85 @@ +--- +title: Object.prototype.eval() +slug: Web/JavaScript/Reference/Global_Objects/Object/eval +translation_of: Archive/Web/JavaScript/Object.eval +--- +<div>{{JSRef}} {{obsolete_header}}</div> + +<p><code><strong>Object.eval()</strong></code> 方法用于在对象的上下文中对 JavaScript 代码字符串求值,但该方法已被移除。</p> + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox"><code><var>obj</var>.eval(<var>string</var>)</code></pre> + +<h3 id="参数">参数</h3> + +<dl> + <dt><code>string</code></dt> + <dd>包含任意 JavaScript 表达式、语句或一组语句的字符串。表达式中可包含已有对象的变量与属性。</dd> +</dl> + +<h2 id="描述">描述</h2> + +<p><code>eval</code> 方法已从对象方法中移除。可使用全局 {{jsxref("Global_Objects/eval", "eval()")}} 函数替代该方法。</p> + +<h2 id="规范">规范</h2> + +<p>暂无规范</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>{{CompatNo}}</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>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + <td>{{CompatNo}}</td> + </tr> + </tbody> +</table> +</div> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{jsxref("Global_Objects/eval", "eval()")}}</li> +</ul> |