记录--关于Jquery uploadify 不能动态传值的问题(java)

动态传值纠结多时后无效, 后得下面一番代码,依旧无效~~

    纳了几个闷,心灰意冷下   清理了 tomcat 一次

再出运行   可以了 

        真心纠结很久很久   无奈之下还是得  清理清理tomcat;

看下面代码 

 
        $("#file").uploadify({
             'swf'         : '/res/uploadify/uploadify.swf',
             'uploader'    : '../Goods/upall' ,
             'buttonText' : '上传',
        'formData':{'key':'value'}, //此传值只能传固定值,比如{'key':'1'} 动态传值的话可不要 'method' : 'GET', 'fileTypeExts' : '*.xls', 'onUploadStart': function (file) { $("#file").uploadify("settings", "formData", { 'goodsId': $("#ID").val()}); //在onUploadStart事件中,也就是上传之前,把参数写好传递到后台。 } });

还有个方法,自测效果

$("#file").uploadify({
             'swf'         : '/res/uploadify/uploadify.swf',
             'uploader'    : '../Goods/upall' ,
             'buttonText' : '上传',
        'formData':{'key':'value'}, //此传值只能传固定值,比如{'key':'1'} 动态传值的话可不要 'method' : 'GET', 'fileTypeExts' : '*.xls' });

$("#file").uploadify("settings", "formData", {'cityId':$('#Query_Query_cityID_txt').val()});

更多uploadify属性请点击:http://www.jqcool.net/jquery-uploadify.html

原文地址:https://www.cnblogs.com/dscs/p/5320561.html