<script>
var picPath;
var image;
function imgShow()
{ if ( image.width == 0 || image.height == 0 ) 
{
setTimeout(imgShow, 1000);
} else 
{
document.getElementById('aPic').src = picPath;
}
}
function loadImage(ele) {
picPath   = getPath(ele);
image     = new Image();
image.src = picPath;
imgShow();
}
function getPath(obj)
{
if(obj)
{
if (window.navigator.userAgent.indexOf("MSIE")>=1)
{
obj.select();
return document.selection.createRange().text;
}
else if(window.navigator.userAgent.indexOf("Firefox")>=1)
{
if(obj.files)
{
return obj.files.item(0).getAsDataURL();
}
return obj.value;
}
return obj.value;
}
}
</script><input type="file" name="pic" id="pic" onchange='loadImage(this)' /><img width="300" height="200" id="aPic" src="">