2011-08-04 85 views
1

有人可以指導我以下代碼有什麼錯誤?非常感謝!javascript上傳錯誤

$(document).ready(function() { 
    var uploader = new qq.FileUploader({ 
    // pass the dom node (ex. $(selector)[0] for jQuery users) 
    element: document.getElementById('file-uploader'), 
    // path to server-side upload script 
    action: '/static/upload/php.php', 
    onComplete: function(id, fileName, responseJSON){ 
     $('#form_upload').html(); 
     $('#form_upload').append('<input type="hidden" name="upload_file" value="'+fileName+'" />'); 
     $('#form_upload').append('<input type="hidden" name="upload_file_path" value="'+/IT1234/01/Week1+'" />'); 
     $('#form_upload').submit(); 
    } 
}); 

回答

0

你的第二個最後一個大括號(})要求後,一個右括號())。之後您還應該放置一個分號(;)。

$(document).ready(function() { 
    var uploader = new qq.FileUploader({ 
    // pass the dom node (ex. $(selector)[0] for jQuery users) 
    element: document.getElementById('file-uploader'), 
    // path to server-side upload script 
    action: '/static/upload/php.php', 
    onComplete: function(id, fileName, responseJSON){ 
     $('#form_upload').html(); 
     $('#form_upload').append('<input type="hidden" name="upload_file" value="'+fileName+'" />'); 
     $('#form_upload').append('<input type="hidden" name="upload_file_path" value="'+/IT1234/01/Week1+'" />'); 
     $('#form_upload').submit(); 
    }); 
});