IE8不会关闭用JavaScript打开窗口的窗口

时间:2013-06-10 17:23:03

标签: javascript

我想运行一个PHP脚本来定位并在新窗口中打开结果,然后关闭运行脚本的原始页面。这是我的剧本。它在IE 9+上运行得很好,但是我们无法在IE 8上运行它。似乎window.close也在关闭“衍生”窗口?

<?php

$sn = $_GET['sn'];

$files = array();

$filepath = '/data/.../.../.../ABC';
$urlpath = 'http://AAA.slcusd.org';

$files = glob("$filepath/$sn*.pdf");

echo "<script type='text/javascript'>\n";

foreach ($files as $fullfilename) {
  $filename = substr($fullfilename, 37, 20);
  echo "window.open('$urlpath/$filename','_blank');\n";
}

echo "window.open('', '_self', ''); window.close();\n";

echo "</script>\n";

?>

0 个答案:

没有答案