评说: 例程2能够的到正确的结果,即用户在提交表单的时候会关闭表单的窗口。 而例程1却会得到出错提示" a is not identified" 即a未被定义。 原因是窗口句柄a(暂且让我这么说吧)的作用域不能将a的“信息”(即a的值) “传递”给新建的窗口。所以只能用 window.close() 而窗口句柄用了默认的当前值。
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn