测试机型:nokia 630. 系统是windows phone 8.1
代码:
<!DOCTYPE html>
<html >
<head>
<title>Files property test</title>
<script type="text/javascript">
function getFiles() {
// Get input element
myFileList = document.getElementById("myfiles");
// loop through files property, using length to get number of files chosen
for (var i = 0; i < myFileList.files.length; i++) {
// display them in the div
document.getElementById("display").innerHTML += "<br/>" + myFileList.files[i].name ;
}
}
</script>
</head>
<body>
<label>Use <strong>shift</strong> or <strong>ctrl</strong> click to pick a few files:
<input type="file" multiple id="myfiles" onchange="getFiles();" /></label>
<div id="display"></div>
</body>
</html>
我用手机自带的IE浏览器可以触发选择文件,但是用微信内置浏览器就没有触发了。
ps:朋友讲windows phone 8.1 跟之前的版本对html文件上传的支持率不一样,我手头也没多余的windows phone了,所以没法去证实了。