Wednesday 15 May 2013

jquery uploadify -


OK, I can not post all the code on this because it's just unnecessary but here's the problem.

I have a tabbed talk (ui.tabs) that contains the uploading form for uploading the file. Although on the first tab I check to determine the position of a radio bootatt that only image files or Flash files should be allowed.

I have already uploaded it, such as $ (document) .ready:

  $ ("# uploadeefi"). Uploadee ({params});  

... including 'fileDesc' and 'fileExt' parameters. In its own right, it works fine but once it starts, I want to change the settings using:

  $ ("# uploadify"). UploadifySettings ('fileDesc', 'blah blah'); . $ ("# Uploadify") uploadifySettings ('fileExt', '.ext');  

... But when I do this, firebug spots the following:

document.getElementById (a (this) .attr ("id") + "uploader"). Update settings are not a function Line 26

Now there is nothing wrong in uploading clearly, but I can have a total noodle here, is this happening Because it thinks that '#uploadify' has not been started so far?

You should look at an acceptable answer. The key is to call $ ("# uploadify"). UploadifySettings (); Submit the Upload Handler inside, or submit the Form Handler.

Overall, should be like JS code:

  jQuery (function ($) {// uploadify $ ("# uploadify"). Uploadify ({params Submit the handle form $ ("#form"). Submit (function (e) {// prefent form submit e.preventDefault (); // uploadify setting, formerly ScriptData $ ("# uploadify") UploadifySettings ("scriptData", {'file_id': '345'}); // Start upload $ ("# uploadeefi"). UploadifyUpload ();});});  

This code works for me, I hope it will work in your case. The form can be replaced by another function, such as Turn On Function Upload, which is present in the script from the uploaded website.


No comments:

Post a Comment