Hola Caricatos, pues el codigo html es este:
Código HTML:
Ver original <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <script type="text/javascript" src="js/uploader.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function ()
{
$('body').on('click','.upload', function()
{
var form = new FormData($('#myform')[0]);
$.ajax(
{
url:'action.php',
type:'POST',
xhr: function()
{
var myXhr = $.ajaxSettings.xhr();
if(myXhr.upload)
{}
return myXhr;
},
success: function (res)
{
$('#content_here_please').html(res);
},
data:form,
cache: false,
contentType:false,
processData:false
});
});
});
<script type="text/javascript" language="javascript"> $(document).ready(function ()
{
if (window.File && window.FileReader && window.FileList && window.Blob)
{
function handleFileSelect(evt)
{
var files=evt.target.files;
var output=[];
var idNumbers=1;
for (var i=0, f; f=files[i]; i++)
{
output.push('
<div id=tempImg'+idNumbers+' style="width:500px;"><div style="float:left; width:484px;">', f.name, ' - ', f.size, ' bytes
</div><div id="preloader'+idNumbers+'" style="display:block; float:left;"><img src="images/ajax-loader.gif"/></div></div>');
idNumbers++;
}
document.getElementById('list').innerHTML=output.join('');
}
document.getElementById('files').addEventListener('change', handleFileSelect, false);
}
});
<form enctype="multipart/form-data" id="myform"> <input id="files" type="file" accept="image/*" multiple name="files[]"/> <input type="button" value="Upload images" class="upload"/> <div id="content_here_please"></div> <div id="tempImg1" style="width:500px;"> <div style="float:left; width:484px;"> hackeado.jpg - 23 bytes
<div id="preloader1" style="display:block; float:left;"> <img src="images/ajax-loader.gif">
<div id="tempImg2" style="width:500px;"> <div style="float:left; width:484px;"> img_profil_big.jpg - 28749 bytes
<div id="preloader2" style="display:block; float:left;"> <img src="images/ajax-loader.gif">
<div id="tempImg3" style="width:500px;"> <div style="float:left; width:484px;"> logo.jpg - 23760 bytes
<div id="preloader3" style="display:block; float:left;"> <img src="images/ajax-loader.gif">
No se porque me deja hacer esto en javascript
:
Código Javascript
:
Ver original<script type="text/javascript" language="javascript">document.getElementById("tempImg1").innerHTML="";</script>
pero esto no
Código Javascript
:
Ver original<script type='text/javascript' language='javascript'>document.getElementById('preloader1').style.display='none';</script>