正如标题所说..有没有办法让它与IE一起工作?使元素在IE中可见?
我使用:
document.getElementById('loadingImage').style.visibility='visible';
对于
<img id="loadingImage" src="images/25.gif" style="padding:0px;margin-bottom:-7px;visibility:hidden;">
但它无法正常工作。谢谢。
编辑: 是被调用列表此alert then reload page IN detect file extension upload script:
function TestFileType(fileName, fileTypes) {
if (!fileName) return;
dots = fileName.split(".")
//get the part AFTER the LAST period.
fileType = "." + dots[dots.length-1];
if (fileTypes.join(".").indexOf(fileType) != -1) {
document.getElementById('loadingImage').style.visibility='visible';
return true;
} else {
alert('Please select (.w3g) file only!');
return false;
}
}
与
<input name="replay_file" id="replay_file" type="file" accept=".w3g*"/>
<input type="submit" id="upload_file" value="Upload" name="uploadReplay" onClick="return TestFileType(this.form.replay_file.value, ['w3g','.w3g']);" />
<img id="loadingImage" src="images/25.gif" style="padding:0px;margin-bottom:-7px;visibility:hidden;">
PS:这是不是因为其他人没有这样一个重复的问题有关。
你是怎么称呼它的?有错误吗?没有足够的细节来告诉你为什么。 – epascarello
这段代码可以正常工作:http://jsfiddle.net/3P2gX/问题在别的地方。控制台中是否有任何错误消息?你可以将其余的代码发布到你设置可见性的地方吗? – Shmiddty
你只提到IE浏览器 - 你是说相同的代码在其他浏览器的作品?您的脚本是否在图像元素解析后运行? (也就是说,在图像和/或onload处理程序或其他事件处理程序在页面加载后运行后,脚本块中的那行代码?) – nnnnnn