asp.net mvc 4 - Cannot read property 'opacity' of undefined -


i loading fine uploader in manner:

var uploader = new qq.fineuploaderbasic({                 button: $("#docaddhref"),                 request: {                     endpoint: 'server/handleuploads'                 },                 validation: {                     allowedextensions: ['jpeg', 'jpg', 'gif', 'png'],                     sizelimit: 204800 // 200 kb = 200 * 1024 bytes                 },                 callbacks: {                     onsubmit: function (id, filename) {                         $messages.append('<div id="file-' + id + '" class="alert" style="margin: 20px 0 0"></div>');                     },                     onupload: function (id, filename) {                         $('#file-' + id).addclass('alert-info')                                         .html('<img src="client/loading.gif" alt="initializing. please hold."> ' +                                               'initializing ' +                                               '“' + filename + '”');                     },                     onprogress: function (id, filename, loaded, total) {                         if (loaded < total) {                             progress = math.round(loaded / total * 100) + '% of ' + math.round(total / 1024) + ' kb';                             $('#file-' + id).removeclass('alert-info')                                             .html('<img src="client/loading.gif" alt="in progress. please hold."> ' +                                                   'uploading ' +                                                   '“' + filename + '” ' +                                                   progress);                         } else {                             $('#file-' + id).addclass('alert-info')                                             .html('<img src="client/loading.gif" alt="saving. please hold."> ' +                                                   'saving ' +                                                   '“' + filename + '”');                         }                     },                     oncomplete: function (id, filename, responsejson) {                         if (responsejson.success) {                             $('#file-' + id).removeclass('alert-info')                                             .addclass('alert-success')                                             .html('<i class="icon-ok"></i> ' +                                                   'successfully saved ' +                                                   '“' + filename + '”' +                                                   '<br><img src="img/success.jpg" alt="' + filename + '">');                         } else {                             $('#file-' + id).removeclass('alert-info')                                             .addclass('alert-error')                                             .html('<i class="icon-exclamation-sign"></i> ' +                                                   'error ' +                                                   '“' + filename + '”: ' +                                                   responsejson.error);                         }                     },                     onerror: function (id, name, reason, xhr) {                         $('#fuberroralert .message').text(reason);                          $('#fuberroralert button').click(function () {                             $('#fuberroralert').hide();                         });                          $('#fuberroralert').show();                     }                 }             });             console.log('uploader called');             uploader(); 

when page loads getting javascript error:

cannot read property 'opacity' of undefined

i installed fineuploader via nuget pacakage asp.net

https://github.com/widen/fine-uploader-server/tree/master/asp.net%20mvc%20c%23

please advice!

your button option problem. should change to:

button: $("#docaddhref")[0] 

if want things pass in jquery object, need download , use fine uploader's jquery plugin. more info plugin @ http://docs.fineuploader.com/integrating/jquery.html


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -