现在的位置: 首页 > 综合 > 正文

IE6和IE7关闭窗口时提示 及上传图片前的本地预览解决办法

2011年05月21日 ⁄ 综合 ⁄ 共 957字 ⁄ 字号 评论关闭

<script type="text/javascript">
function CloseWin() //这个会提示是否关闭浏览器
{
window.opener=null;
window.open("","_self");
window.close();
}
//如果在框架中关闭整个框架页面的话如下
//这个是不提示关闭
function  aa  (   )
      {
         
           if (window.confirm('您确认要退出系统吗?'))
           {
             top.opener=null;
             top.open("","_self");
             top.close();
             window.close;
            
            }
         else
          {return false;}
        
       
       
      }

function Preview(imgFile)
{
document.getElementById("pic").filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
var img=new Image();
img.src=imgFile.value;
alert(img.fileSize);
alert(img.width);
alert(img.height);
}
</script>

<a href="javascript:CloseWin();"> 点击这里无提示关闭当前窗口</a><br />

请选择要预览的图片:<input type="file" onchange="javascript:Preview(this);" /><br />
<div id="pic" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:400px;height:200px;"></div>

 

源文件下载:/Files/chinhr/ie6--7.htm

抱歉!评论已关闭.