我的上传表单运行良好,但我想以编程方式更改设置,但出现错误。
Uploadify 在 document.ready 上启动,我正在尝试将 updateSettings 绑定到按钮单击(也在 document.ready 中完成)。我还尝试在 document.ready 之外使用 updateSettings 函数 - 实际上是在按钮上或只是内联脚本上以获得相同的错误。
错误是
Error: document.getElementById(a(this).attr("id") + "Uploader").updateSettings is not a function
我的代码目前看起来像
<script>
$(document).ready(function(){
$('#uploadify').uploadify({
'uploader' : 'uploadify.swf',
'script' : 'uploadify.php',
'cancelImg' : 'cancel.png',
'auto' : true,
'folder' : '/uploads'
});
$("#changeIt").click(function(){
$("#uploadify").uploadifySettings("folder","something_else");
});
});
</script>
<input type="file" name="uploadify" id="uploadify" />
<a id="changeIt" src="#">Change the upload dir</a>
就像我说的,我尝试在 document.ready 之外添加 uploadifySettings,我还尝试在 a 标签本身的 onclick 中添加它以获得相同的错误。我真的很感激任何帮助。