日期:2014-05-16 浏览次数:20395 次
<input type="button" onClick="$('#up').click();" value="上传照片">
<form action="b.php" method="post" enctype="multipart/form-data" target="uploadIframe" id="form1" style="display:none">
<input type="file" name="up" id="up" onchange="$('#sub').click(); ">
<input type="submit" name='sub' id="sub">
</form>
<iframe name="uploadIframe" id="uploadIframe" style="display:none"></iframe>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>alert('1')</script>
<form action="b.php" method="post" enctype="multipart/form-data" target="uploadIframe" id="form1">
<input type="file" name="up" id="up" onchange="this.parentNode.submit()" style="border: 1px solid red;border:1px solid red;position: absolute;filter: alpha(opacity=0);opacity: 0;width: 100px">
<input type="button" value="上传照片">
</form>
<iframe name="uploadIframe" id="uploadIframe" style="display:none"></iframe>