drayarms Posted May 24, 2012 Share Posted May 24, 2012 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML1.0 Transitional//EN" "http//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type = "text/javascript" src="http://code.jquery.com/jquery-latest.js"> </script> <script type="text/javascript"> function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#blah').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } } </script> </head> <body> <form id="form1" runat="server" enctype="multipart/form-data"> <input type='file' onchange="readURL(this);" /> <img id="blah" src="#" width = "300px" max-height = "340px" alt="your image" /> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/263074-cross-browser-compatibility-issues-with-image-preview-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.