1
代碼如下。有一個文件預覽按鈕,它在Chrome和Firefox中很好地顯示,但在IE中沒有顯示。在Internet Explorer瀏覽器中未顯示Php文件預覽按鈕
$ua = htmlentities($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, 'UTF-8');
if (preg_match('~MSIE|Internet Explorer~i', $ua) || (strpos($ua, Trident/7.0; rv:11.0') !== false)) {
// do stuff for IE
}
else{
if(strtolower($aRow["extension"])=='pdf')
{
$editable .="<a class=\"iframe\" href=\"javascript:viewPdf('http://{$_SERVER['SERVER_NAME']}{$script_dir}{
$aRow["path"]}');\" title=\"Preview\"><span class=\"glyphicon glyphicon-zoom-in\"></span></a> ";
}