2011-07-15 19 views
2

私の英語 のため申し訳ありませんが、私は最近のバージョン(Uploadify-v2.1.4)に私のuploadifyを更新し、それが私のuploadify broked:私は何かをアップロードすることはできません を。 FireBugコンソールは、「NPObjectでメソッドを呼び出すエラー!」を呼び出そうとしているときに、このエラーを返します。NPObjectでメソッドを呼び出す際にエラーが発生しました。

何が間違っているのですか?

ここに私のコードは次のとおりです。 http://pastebin.com/bHeYHxHw

おかげで、

ダニール。

答えて

1

/*元のコード*/ uploadifyCancel:機能(ID){

     jQuery(this).each(function() { 



          document.getElementById(jQuery(this).attr('id') + 'Uploader').cancelFileUpload(ID, true, true, false); 

         }); 

        }, 

/*新しいコード*/

uploadifyCancel:function(ID){ 

       jQuery(this).each(function(){ 

        document.getElementById(jQuery(this).attr("id")+"Uploader").cancelFileUpload(ID,true,false) 

       }); 

      }, 

/*元のコード*/

      jQuery(this).bind("uploadifyComplete", { 

           'action': settings.onComplete 

           }, function(event, ID, fileObj, response, data) { 

           if (event.data.action(event, ID, fileObj, unescape(response), data) !== false) { 

            jQuery("#" + jQuery(this).attr('id') + ID).find('.percentage').text(' - Completed'); 

            if (settings.removeCompleted) { 

             jQuery("#" + jQuery(event.target).attr('id') + ID).fadeOut(250,function() { 

              jQuery(this).remove() 

              }); 

           } 

           jQuery("#" + jQuery(event.target).attr('id') + ID).addClass('completed'); 

           } 

          }); 

/*新規コード*/

jQueryの(この).bind( "uploadifyProgress"、{

    'action': settings.onProgress, 

        'toDisplay': settings.displayData 

       }, function(event, ID, fileObj, data) { 

        if (event.data.action(event, ID, fileObj, data) !== false) { 

         jQuery("#" + jQuery(this).attr('id') + ID + "ProgressBar").animate({ 

          'width': data.percentage + '%' 

         },250,function() { 

          if (data.percentage == 100) { 

           jQuery(this).closest('.uploadifyProgress').fadeOut(250,function() { 

            jQuery(this).remove() 

           }); 

          } 

         }); 

         if (event.data.toDisplay == 'percentage') displayData = ' - ' + data.percentage + '%'; 

         if (event.data.toDisplay == 'speed') displayData = ' - ' + data.speed + 'KB/s'; 

         if (event.data.toDisplay == null) displayData = ' '; 

         jQuery("#" + jQuery(this).attr('id') + ID).find('.percentage').text(displayData); 

        } 

       }); 
+0

あなたはjqueryのを使用しているとき、神の名において、あなたがのdocument.getElementByIdを使用しているのはなぜ???? –

+0

@B T:あなたは何を話そうとしているのですか?あなたは詳細を教えていただけますか? –

+0

@BT少し遅かったですが、SommathはUploadify JQueryプラグインがそれを使用するので 'getElementById'を使いました。彼はちょうどいくつかのコードをコピーし、貼り付け、修正します(すべてではありません)。 –

関連する問題