Created
February 27, 2012 01:58
-
-
Save z8888q/1920690 to your computer and use it in GitHub Desktop.
打开你选择的文本文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function showi(ptu) | |
{try{ | |
var ado=new ActiveXObject("ADODB.Stream") | |
ado.Type=2 | |
ado.Mode = 3 | |
ado.Charset = "GB2312" | |
ado.Open() | |
ado.LoadFromFile(ptu) | |
var doc=ado.ReadText() | |
ado.Close() | |
dv.document.body.innerText=doc | |
}catch(e){ssay="" | |
for(i in e){ssay+=i+":"+eval('e.'+i)+"\n"} | |
alert(ssay)}} | |
</script> | |
<input type="file" name="fle" onchange=showi(fle.value)> | |
<iframe width="100%" height="80%" name="dv" id="dv"></iframe> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment