Maison >interface Web >tutoriel HTML >求教,如何使用SwfUpload控件的addPostParam方法?_html/css_WEB-ITnose

求教,如何使用SwfUpload控件的addPostParam方法?_html/css_WEB-ITnose

WBOY
WBOYoriginal
2016-06-24 12:21:37994parcourir

控件 上传 SwfUpload addPostParam

<script> <br /> var swfu; <br /> window.onload = function () { <br /> var jgdh = document.getElementById("jgdh").value; <br /> var dept = document.getElementById("dept").value; <br /> swfu = new SWFUpload({ <br /> upload_url: "addfcmate", <br /> file_post_name : "Filedata", <br /> post_params: { <br /> "sessionid" : "<%=session.getId() %>", <br /> "newfc.jgdh" : jgdh, <br /> "newfc.dept" : dept <br /> }, <br /> <br /> // File Upload Settings <br /> file_size_limit : "10 MB", // 1000MB <br /> file_types : "*.*", <br /> file_types_description : "所有文件", <br /> file_upload_limit : "0", <br /> <br /> file_queue_error_handler : fileQueueError, <br /> file_dialog_complete_handler : fileDialogComplete,//选择好文件后提交 <br /> file_queued_handler : fileQueued, <br /> upload_progress_handler : uploadProgress, <br /> upload_error_handler : uploadError, <br /> upload_success_handler : uploadSuccess, <br /> upload_complete_handler : uploadComplete, <br /> <br /> // Button Settings <br /> button_image_url : "swfupload/images/small.png", <br /> button_placeholder_id : "filebutton", <br /> button_width: 180, <br /> button_height: 18, <br /> button_text : '<span class="button">请选择文件', <br /> button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }', <br /> button_text_top_padding: 0, <br /> button_text_left_padding: 18, <br /> button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT, <br /> button_cursor: SWFUpload.CURSOR.HAND, <br /> <br /> // Flash Settings <br /> flash_url : "swfupload/js/swfupload.swf", <br /> <br /> custom_settings : { <br /> upload_target : "divFileProgressContainer" <br /> }, <br /> // Debug Settings <br /> debug: false //是否显示调试窗口 <br /> }); <br /> }; <br /> <br /> function startUploadFile(){ <br /> swfu.startUpload(); <br /> } <br /> function checkvalue(){ <br /> //可添加值检验方法 <br /> } <br /> function addfcinfo(){ <br /> var params = { <br /> "newfc.jgdh" : $("#jgdh").val(), <br /> "newfc.jgmc" : $("#jgmc").val(), <br /> "newfc.dept" : $("#dept").val(), <br /> "newfc.deptname" : $("#deptname").val(), <br /> "newfc.jg" : $("#jg").val(), <br /> "newfc.cs" : $("#cs").val(), <br /> "newfc.jznd" : $("#jznd").val(), <br /> "newfc.jzmj" : $("#jzmj").val(), <br /> "newfc.fczdjh" : $("#fczdjh").val(), <br /> "newfc.tdz" : $("#tdz").val(), <br /> "newfc.fcjz" : $("#fcjz").val(), <br /> "newfc.djrq" : $("#djrq").val(), <br /> "newfc.djry" : $("#djry").val() <br /> }; <br /> $.ajax({ <br /> url:'addfcinfo', <br /> type:'post', <br /> dataType:'json', <br /> data:params, <br /> success:getaddresult_callBack <br /> }); <br /> } <br /> function getaddresult_callBack(data){ <br /> if(data.subflag){ <br /> alert("添加房产信息成功"); <br /> alert(data.newfc.fc_id); <br /> swfu.addPostParam("newfc.jg","111"); <br /> $(".info").attr("readonly","readonly"); <br /> $(".info").css("background-color","gray"); <br /> $("#filerow").css("display","inline"); <br /> $("#fcinfosub").attr("disabled","disabled"); <br /> } <br /> } <br /> jquery事件返回后给控件对象传个新的参数,结果执行这句时报“例外被抛出且未被接住”,是不是我的方法使用的有问题? <br /> <h2>回复讨论(解决方案) <p class="sougouAnswer"> 求不沉。。。。求指点~ <p class="sougouAnswer"> 不推荐使用swfupload组件,各个浏览器下 上传按钮有的显示,有的不显示,整过一个,主要是和flash的版本有关。太纠结了,最后就换了。 </script>
Déclaration:
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn