Forum Moderators: open

Message Too Old, No Replies

Image Preview in Mozilla Browser

Image Preview in Mozilla Browser

         

Madhura

6:22 am on Jun 22, 2006 (gmt 0)

10+ Year Member



Image Preview in Mozilla Browser:
using "document.createElement()" function - <input type=file> browse button is created. In this - onchange event, i've to preview the image. It is working fine in IE but not in Mozilla. Please Help me Soon!

adni18

6:42 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might not want to use onchange for mozilla, maybe run an infinite Timeout loop, something like this:


<img src="http://google.com/images/logo.gif" alt="" id="pix">
<input type="file" id="myfile">

<script type="text/javascript">
<!--

function doCheckIt()
{
document.getElementById("pix").src=document.getElementById("myfile").value;
window.setTimeout("doCheckIt()", 200)
}
doCheckIt()

//-->
</script>

That should work. Haven't tested it yet, though.