1

我进行了快速搜索,但找不到解决方案,

我是 js 新手,如果这是一个愚蠢的简单问题,我很抱歉,

但是是否有可能有一些js,当用户单击按钮时,javascript会按下按钮两次

这是我希望 js 工作的按钮:

   <p:fileUpload widgetVar="upload" id="upload" fileUploadListener="#{fileUploadController.handleFileUpload}"
                                  mode="advanced" 
                                  multiple="false" 
                                  update="messages Nav upload fileDirectoryViewer"
                                  label="Select File"
                                  sizeLimit="30720000"  
                                  allowTypes="/(\.|\/)(gif|jpe?g|png|doc|txt|pdf|html)$/"
                                  auto="true"
                                  disabled="#{fileUploadController.uploadComplete}"
                                  /> 

这是该页面的源代码:

            <!--&lt;p:growl id=&quot;messages&quot; showSummary=&quot;true&quot; showDetail=&quot;true&quot; /&gt; --><div id="j_idt8:upload" class="ui-fileupload ui-widget"><div class="fileupload-buttonbar ui-widget-header ui-corner-top"><label class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-icon-left fileinput-button"><span class="ui-button-icon-left ui-icon ui-c ui-icon-plusthick"></span><span class="ui-button-text ui-c">Select File</span><input type="file" id="j_idt8:upload_input" name="j_idt8:upload_input" /></label></div><div class="fileupload-content ui-widget-content ui-corner-bottom"><table class="files"></table></div></div><script id="j_idt8:upload_s" type="text/javascript">$(function(){PrimeFaces.cw('FileUpload','upload',{id:'j_idt8:upload',mode:'advanced',autoUpload:true,dnd:true,update:'j_idt8:messages j_idt8:Nav j_idt8:upload j_idt8:fileDirectoryViewer',process:'@none',maxFileSize:30720000,acceptFileTypes:/(\.|\/)(gif|jpe?g|png|doc|txt|pdf|html)$/},'fileupload');});</script> 

多谢你们 :)

4

0 回答 0