0
我试图在文件上传到服务器时显示加载gif。使用webpy后端,我能够成功上传文件等,但遇到问题让我的jQuery认识到按钮被点击。HTML提交后jQuery表单触发器动作
<html>
<head>
<script type="text/javascript" src="/static/jquery.js"></script>
</head>
<div id="form_wrapper">
<script type="text/javascript">
jQuery(document).ready(function)(){
jQuery('#sub').click(function(){
jQuery('#gifdiv').show();
jQuery('#form').hide();
});
});
</script>
<div id="gifdiv" style="display: none">
<img src="/static/some.gif" style="display: auto;" id="loading">
</div>
<div id="form" style:"display: auto">
<form action="/" method="POST" enctype="multipart/form-data" id="myform">
<input type="file" name="file">
<br>
<input class="button" type="submit" id="sub">
</form>
</div>
</div>
</html>
上传是使用Ajax还是经典的提交表单? – GeekRiky 2015-02-09 18:03:12
很明显是经典的提交 – 2015-02-09 18:03:32
其使用经典的html提交 – 1ifbyLAN2ifbyC 2015-02-09 18:09:35