Uploadify cancel individual file problem
I have implemented uploadify in to my web application and it all works brilliantly except one thing. When the files are displaye开发者_如何转开发d in the queue, when I go to remove one from the queue I get an error.
The error is:
illegal character jQuery(\'#'+a(this).attr(
and the code which this refers to is this:
<a href="javascript:jQuery(\'#'+a(this).attr("id")+"').uploadifyCancel('"+i+'\')">
If you could advise me that would be great. Thanks.
This was the working code, he just modified it wrong.
<a href="javascript:$('#file_upload').uploadifyCancel($('.uploadifyQueueItem').eq(i).attr('id').replace('file_upload',''))">
The i variable defines which upload in the queue to cancel i.e. 0 is first, 1 second, -1 is last, -2 second last etc.. Alernatively if you have already grabbed the upload ID from uploadify, you can just do..
<a href="javascript:$('#file_upload').uploadifyCancel(ID)">
For reference in case anyone ends up here http://www.uploadify.com/documentation/methods/uploadifycancel/
Also see http://api.jquery.com/eq/
I think you are getting the quotes mixed up and escaped wrong. Try this:
<a href="javascript:jQuery('#'+a(this).attr('id')).uploadifyCancel(i)">
Your quotation marks are wrong.
the value of the href
attribute should be surrounded by " marks. The value itself should contain only ' marks. Escape them properly (\') when necessary.
精彩评论