1 IE6和IE7关闭窗口时提示和不提示
2 上传文件立即显示效果图,在ie7中可以用滤镜
<!--
以下均支持IE6和IE7,不支持Firefox2.0,其他浏览器未经测试
-->
<
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;

}
</
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
>
获取图片的大小
var img=new Image();
img.src=imgFile.value;
alert(img.fileSize);
alert(img.width);
alert(img.height);
2 上传文件立即显示效果图,在ie7中可以用滤镜









































var img=new Image();
img.src=imgFile.value;
alert(img.fileSize);
alert(img.width);
alert(img.height);
本文转自高海东博客园博客,原文链接:http://www.cnblogs.com/ghd258/archive/2007/06/19/788797.html,如需转载请自行联系原作者