uploadify - setting cookie in "onComplete" breaks it?
Hi,
I'm trying to set a cookie, so I know that a file has been successfully uploaded.
I have:
- onComplete: function(a, b, c, d, e) {
- if (d != '1') {
- var the_error = d;
- var content_to_add = '<b>ERROR:</b> ' + c.name + ' - ' + the_error + '<br />';
- $('#errorList').append(content_to_add).fadeIn('slow');
- } else {
- $.cookie("viduploaded", "1");
- var tmp_size = c.size / 1024;
- var the_size_in_kb = Math.round(tmp_size * 100) / 100;
- var content_to_add = '<div id="upload_' + b + '">' + c.name + ' ( ' + the_size_in_kb + 'kb ) <a href="javascript: void(0);" onclick="remove_image('' + c.name + '','<%temp_id%>','' + b + '')"><img src="<%config.build_static_url%>/ajax_upload/cancel.png" /></a><br /></div>';
- $('#successQueue').append(content_to_add).fadeIn('slow');
- }
- }
This seems to break it though:
- $.cookie("viduploaded", "1");
If I move that line to below:
- $('#successQueue').append(content_to_add).fadeIn('slow');
...its runs fine BUT the cookie is not set :/
Any suggestions?
TIA!
Andy