| 
 | 
 
          
            | 
                 
                  | 获取提交时的图片尺寸 |   
                  | 〖编辑:Cloudy | 浏览:人次〗 |  
                 
                  | <script> var img=null;
 function s()
 {
 if(img)img.removeNode(true);
 img=document.createElement("img");
 img.style.position="absolute";
 img.style.visibility="hidden";
 img.attachEvent("onreadystatechange",orsc);
 img.attachEvent("onerror",oe);
 document.body.insertAdjacentElement("beforeend",img);
 img.src=form1.inp.value;
 }
 function oe()
 {
 alert("cant load img");
 }
 function orsc()
 {
 var Height,width;
 if(img.readyState!="complete")return false;
 Height=img.offsetHeight;
 Width=img.offsetWidth;
 document.form1.action="test1.asp?height="+Height+"&width="+Width;
 document.form1.submit();
 return true;
 }
 </script>
 <form name="form1" method="post" action="test1.asp" enctype="multipart/form-data">
 <input type="file" name="file2" id="inp" value="默认值">
 <input type="button" name="Submit" value="Submit" onclick="s()">
 </form>
 
 |   
                  | 录入时间:2006-05-06 11:08:19    [打印本页] 
                    [关闭窗口] 
                    [返回顶部]
 |  
                
                  | 特别声明: 本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。 |  |  
 |