아직 답변을 드릴 수 없습니다. 그래서 저는 대신 여기에 쓰고 있습니다.
봅니다이를 이용하여 하나의 업로드 작업을 (링크가 올바른 위치에의 지점 확인)하기 : 당신이 그 일을 얻을 수있을 때, 당신은이 일을 할 수 있어야한다
$('#listing_image').uploadify({
'uploader' : 'uploadify.swf',
'script' : 'uploadify.php',
'cancelImg' : 'cancel.png',
'folder' : '/listing_image_TempImage',
onComplete: function(){
// Do oncomplete stuff.
}
});
.
var uploads = [2,4,5]; // Only number 2,4 and 5
var numberofuploads = uploads.length; // How many is that?
var folderlist = [0, '/folder1', '/folder2', '/folder3', '/folder4', '/folder5', '/folder6']; // List of folders to upload to
var listingimageslist = [0, '#listing_image1', '#listing_image2', '#listing_image3', '#listing_image4', '#listing_image5', '#listing_image6']; // List of form selectors.
var folder = folderlist[uploads[0]]; // What folder should this form upload to
var listingimages = listingimageslist[uploads[0]]; // With what selector can the form be found?
if (numberofuploads > 1)
{
var next = 1; // What upload to initiate after this one?
}
initUpload(listingimages,folder); // make the upload thing work.
function initUpload(e,folder)
{
$(e).uploadify({
'folder' : folder,
'uploader' : 'uploadify.swf',
'script' : 'uploadify.php',
'cancelImg' : 'cancel.png',
onComplete: function(){
var folder = folderlist[uploads[next]];
var listingimages = listingimageslist[uploads[next]];
next++
if (numberofuploads != next)
{
initUpload(listingimages,folder);
}
}
});
};
코드를 테스트하지 않았지만 자바 스크립트가 약간있는 경우 제대로 작동 할 수 있어야합니다.
Remenber는 $ (문서)의 모든 jQuery 코드를 다음과 같이 .ready하기 : 답변
$(document).ready(function() {
// Insert code here
});
대단히 감사합니다 Webbies하지만 여기에 문제가 하나 있는데 .... 처음 두 인스턴스를 확인했지만이 코드는 처음 2 인스턴스의 이미지를 uplaoding하지 않습니다 ... $ ('# listing_image'). uploadify ({ 'folder' : '/ listing_image_TempImage', onComplete : function() {$ ('# listing_image1'). – Shatru
이 답변에서 제공 한 첫 번째 코드 스 니펫을 사용하여 단 하나의 작업을 수행하십시오. – Webbies