Image is not shown in Firefox using JavaScript
An image is not shown in Firefox using JavaScript.
This is the code,
<script type="text/javascript">
function ShowImage(val)
{
document.getElementById(开发者_高级运维'show').innerHTML="<img src='"+val+"'>"
}
</script>
<form name="frmlist" enctype="multipart/form-data" method="post">
Filename: <INPUT type="file" id="videoupload">
<INPUT
type="button"
id="btn_video"
onClick="ShowImage(document.getElementById('videoupload').value);" value="Upload">
</form>
<div id="show"></div>
You are not actually upload the file yet. Firefox and Google Chrome won't display content stored on the local machine. IE will provided that your internet security level is set at medium. But you most probably don't want that. Your script needs to send the local file to a server first so your file becomes available as a url. Then the browser will be able to show it.
精彩评论