上传文件时预览的问题怎么才能预览flsh文件?
<input type="file" name="file1" style="width:300'" class="tx1" value="" onchange="PreviewImg(this);">
<div style="width:400px;height:300px;border:1px solid #aaaaaa;overflow:auto" id="previewDiv">
</div>
<script language="javascript">
function PreviewImg(obj){
var div = document.getElementById("previewDiv");
if(obj.value==""){
div.removeChild(div.firstChild);
return
}
if(div.childNodes.length>0){
div.firstChild.src=obj.value;
div.firstChild.removeAttribute("width");
div.firstChild.removeAttribute("height");
}
else{
var img = document.createElement("embed");
img.src=obj.value;
img.type="application/x-shockwave-flash";
img.height=300;
img.width=400;
div.appendChild(img);
}
}
</script>
我这样做为什么不能实现呀?
<div style="width:400px;height:300px;border:1px solid #aaaaaa;overflow:auto" id="previewDiv">
</div>
<script language="javascript">
function PreviewImg(obj){
var div = document.getElementById("previewDiv");
if(obj.value==""){
div.removeChild(div.firstChild);
return
}
if(div.childNodes.length>0){
div.firstChild.src=obj.value;
div.firstChild.removeAttribute("width");
div.firstChild.removeAttribute("height");
}
else{
var img = document.createElement("embed");
img.src=obj.value;
img.type="application/x-shockwave-flash";
img.height=300;
img.width=400;
div.appendChild(img);
}
}
</script>
我这样做为什么不能实现呀?
...全文
相关推荐
机械设计管内检测机器人sw20非常好的设计图纸100%好用.zip
机械设计管内检测机器人sw20非常好的设计图纸100%好用.zip
机械设计龙门桁架机器人sw20非常好的设计图纸100%好用.zip
机械设计龙门桁架机器人sw20非常好的设计图纸100%好用.zip
机械设计单机器人3工位工作站sw20非常好的设计图纸100%好用.zip
机械设计单机器人3工位工作站sw20非常好的设计图纸100%好用.zip
机械设计I Robot履带车机器人sw20可编辑非常好的设计图纸100%好用.zip
机械设计I Robot履带车机器人sw20可编辑非常好的设计图纸100%好用.zip
机械设计树木切割器sw20非常好的设计图纸100%好用.zip
机械设计树木切割器sw20非常好的设计图纸100%好用.zip


