【发布时间】:2019-11-30 03:22:05
【问题描述】:
<script>window.extractKey = 'value'</script>
我必须提取 window.extractKey 的值,该值存在于我的 html 源代码中。
P.S.- 我必须使用 javascript 方法提取值。
【问题讨论】:
标签: javascript jquery html json object
<script>window.extractKey = 'value'</script>
我必须提取 window.extractKey 的值,该值存在于我的 html 源代码中。
P.S.- 我必须使用 javascript 方法提取值。
【问题讨论】:
标签: javascript jquery html json object
页面上的所有脚本标记都具有并修改相同的window。它工作正常:
<script>
window.extractKey = 'value'
</script>
<script>
const res = window.extractKey;
console.log(res);
</script>
【讨论】: