var btnUpload=$('#upload');
var status=$('#status');
var dataString = $('#form').serialize();//собираем все данные в строку
new AjaxUpload(btnUpload, {
action: 'add_foto.php?foto_temp=1',//+$('#opis').val(),
data: dataString,
name: 'uploadfile',
onSubmit: function(file, ext){
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
status.text('Only JPG, PNG or GIF files are allowed');
return false;
}
status.text('Uploading...');
},
onComplete: function(file, response){
//On completion clear the status
status.text('');
//Add uploaded file to list
if(response!=="success"){
del_foto();
$('#upload').hide();
var imsrc='im/'+file;
$('img#NewPhoto').attr({ 'src': imsrc});
$('#Foto_Name').val(imsrc);
$('#foto_forma').show();
}
}
});
Как модифицировать код,чтобы диалог отрывлась сразу после загрузки страницы?