Comentario: Este artículo presenta principalmente el ejemplo de vista previa de la carga de imagen HTML5. Los amigos que lo necesitan pueden referirse a él.
<! Doctype html>
<html lang = "zh-cn">
<Evista>
<meta charset = "utf-8" />
<meta content = "edielei" />
<title> HTML5 Imagen Subiendo Vista previa </title>
<script type = "text/javascript" src = "<a href =" http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js "> </script"> "> </script </a >>
<script type = "text/javaScript">
$ (function () {
$ ('#img'). Change (function () {
archivo var = this.files [0]; // Seleccione el archivo cargado
var r = new FileReader ();
R.ReadasDataurl (archivo); // Base64
$ (r) .load (function () {
$ ('div'). html ('<img src = "' + this.result + '" />');
});
});
});
</script>
</ablo>
<Body>
<H3> HTML5 Imagen Subiendo Vista previa </h3>
<input type = "file" acepta = "Image /*" />
<div> </div>
</body>
</html>