2010-06-23 22 views
0

我有一個文件的uploadify按鈕,工作正常,但本身。jquery uploadify在阿賈克斯工作電話

但是,我有一個父文件,用uploadify調用文件並將其顯示在div中。這沒有用。有沒有一種方法來初始化uploadifier當AJAX調用時

感謝

編輯 對不起球員

OK對不起..

我有一個叫瀏覽文件鏈接..

<a rel="button" href="index.cfm?action=File_Manager>Browse Files</a><div id="_browse_resource_image" class="gallery_container"></div> 

這會在_browse_resource_image div中加載我的文件管理器..文件管理器允許用戶查看服務器上的文件和n進入文件夾和選擇文件等..在文件管理器裏面是上傳按鈕,這將允許用戶上傳文件到用戶目前的目錄..希望這是有道理的?

$(document).ready(function() { 
$("##fileInput1").uploadify({ 
    'uploader'  : '../assets/js/uploadify.swf', 
    'script'   : 'file_manager/upload.cfm', 
    'cancelImg'  : 'file_manager/cancel.png', 
    'multi'   : true, 
    'buttonImg'  : '../assets/img/upload.gif', 
    'auto'   : 'true', 
    'height'   : '23', 
     'folder'  : $("##_browse_resource_image_path").val(), 
    'fileDesc'  : 'All Images and Documents Only', 
    'fileExt'  : '*.jpg;*.jpeg;*.png;*.gif;*.pdf;*.doc;*.docx' 

}); 

});

文件夾是問題,如果它的外部ajax我需要使用JS butinside我可以使用Coldfusion。

+0

你能顯示一些代碼嗎?我不明白你在做什麼。 – 2010-06-23 11:08:07

+0

您沒有指定足夠的信息讓人們瞭解正在發生的事情。請提供一些關於您的原始按鈕的工作原理以及如何從「其他文件」調用它的詳細信息。 – 2010-06-23 11:09:14

回答

0

你是如何加載包含uploadify的部分內容的?因爲你正在使用jQuery它可能是你使用jQuery.get http://api.jquery.com/jQuery.get/來做這個Ajax調用。

,如果是這樣,你必須使用的liveQuery的伎倆

歡呼jQuery的文件

$.get('ajax/test.html', function(data) { 
     alert('Load was performed.'); 
     //your init code 
}); 
0
<script type="text/javascript"> 

$('##fileInput1').livequery(function(){ 
    $(this).uploadify({ 
     'uploader'  : '../assets/js/uploadify.swf', 
     'script'   : 'file_manager/upload.cfm', 
     'cancelImg'  : 'file_manager/cancel.png', 
     'multi'   : true, 
     'buttonImg'  : '../assets/img/upload.gif', 
     'auto'   : 'true', 
     'height'   : '23', 
     'folder'   : $("##_browse_resource_image_path").val(), 
     'fileDesc'  : 'All Images and Documents Only', 
     'fileExt'  : '*.jpg;*.jpeg;*.png;*.gif;*.pdf;*.doc;*.docx' 
    }); 
}); 
</script> 

初始化uploadifier在回調函數

的情況爲例