<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link href="css/mui.min.css" rel="stylesheet" />
<style>
.xiantu{
70px;
height: 70px;
border-bottom: 1px solid saddlebrown;
background-image: url(img/3.jpg);
background-size: 100% 100%;
}
.xiantu input{
70px;
height: 70px;
opacity: 0;
}
</style>
</head>
<body>
<div class="xiantu">
<input type="file" id="file">
</div>
<iframe src="" width="300" height="300"></iframe>
<script>
var img=document.getElementById("file");
img.onchange=function() {
var reader=new FileReader();
reader.readAsDataURL(img.files[0]);
reader.onload=function(){
document.getElementsByTagName("iframe")[0].setAttribute("src",reader.result)
}
}
</script>
<script src="js/mui.min.js"></script>
<script type="text/javascript">
mui.init()
</script>
</body>
</html>
用来转译上传的text文件