test code浏览和IE操作FileSystemObject
来源:互联网 发布:linux gid是什么意思 编辑:程序博客网 时间:2024/06/03 13:55
<!DOCTYPE html><html lang="zh-cn"><head><meta charset="gb2312" /><meta name="robots" content="all" /><meta name="author" content="foson" /><link rel="stylesheet" type="text/css" href="tc.css" /><script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script><title>HTML测试工具 V2</title></head><body id="editor"><div id="wrapper"><div id="header"><h1>HTML TIY</h1></div><div id="a_form" style="float:left;"><form action="/tiy/v.asp" method="post" id="tryitform" name="tryitform" onSubmit="validateForm();" target="i"><div id="CodeArea"><h2>编辑您的代码:</h2><!-- iframe code --><textarea id="TestCode" cols="60" rows="20" wrap="logical"></textarea><!-- iframe code --></div><br><div id="butt"><input type="button" value="read" onClick='readFileAsText()'><input type="button" value="clear" onClick='clearTA()'><input type="button" value="start" onClick='editHTML()'><br><br><input type="file" id="chooseFile"><br><br><input type="button" value="testVedio" onClick='testVedio()'></div><input type="hidden" id="code" name="code" /><input type="hidden" id="bt" name="bt" /></form></div><div id="result" style="float:right;"><h2>查看结果:</h2><iframe id="aIFrame" frameborder="1" name="iframe1" width="700px" height="650px" scrolling="yes" src="HTML TIY src/rsc.html"></iframe></div></div><script type="text/javascript">function editHTML(){ var fso1 = new ActiveXObject("Scripting.FileSystemObject"); var f1 = fso1.OpenTextFile("C://Users/mengli01/Desktop/My Projects/jQuery/HTML TIY src/rsc.html",2,true); f1.WriteLine(""); f1.Close(); var fso2 = new ActiveXObject("Scripting.FileSystemObject"); var f2 = fso2.OpenTextFile("C://Users/mengli01/Desktop/My Projects/jQuery/HTML TIY src/rsc.html",8,true); var aHtml=$("#TestCode").val(); var lines=aHtml.split("\n"); for(var i=0;i<lines.length;i++){ f2.WriteLine(lines[i]); } f2.Close(); var ifRefresh=true;//confirm("Write Complete.\nReload Now?"); if(ifRefresh){ $("#aIFrame").attr("src",$("#aIFrame").attr("src"));//document.all.iframe1.document.location.reload(true);//aIFrame.window.location.reload(true); alert("Reload Complete"); }}function testVedio(){ $("#TestCode").text('<!DOCTYPE HTML>\r<html>\r<body>\r<video width="320" height="240" controls="controls">\r <source src="../i/movie.ogg" type="video/ogg">\r <source src="HTML TIY src/Mind your own - Ailee Businuss.mp4" type="video/mp4">\rYour browser does not support the video tag.\r</video>\r</body>\r</html>');}function readFileAsText(){ var fso=new ActiveXObject("Scripting.FileSystemObject"); var f=fso.OpenTextFile($("#chooseFile").val(),1,false); var s=""; while(!f.AtEndOfStream){ s+=f.ReadLine()+"\r"; } f.Close(); //alert(s); //return s; $("#TestCode").text(s);}function clearTA(){ $("#TestCode").text("");}</script></body></html>
0 0
- test code浏览和IE操作FileSystemObject
- javascript利用FileSystemObject操作文件和文件夹
- js操作IE浏览器弹出浏览文件夹
- js操作IE浏览器弹出浏览文件夹
- Scripting.FileSystemObject 文件操作
- JS文本操作 Scripting.FileSystemObject
- JS文本操作 Scripting.FileSystemObject
- JS文本操作 Scripting.FileSystemObject
- FileSystemObject
- code test
- Test Code
- Test Code
- Code Test
- TEST Code
- Test.code
- test code
- test code
- code test
- GPUImage实战问题解决
- 当我们说数据挖掘的时候我们在说什么
- uboot源码简要分析
- hdoj 1690 Bus System
- Move Zeroes 带测试版
- test code浏览和IE操作FileSystemObject
- 记一次失败的kaggle比赛(1):赛题简介与初次尝试
- First Bad Version 带测试版
- iOS开发之自定义UITableView
- HDU 4975 最大流+判断环
- RecyclerView
- systemctl 命令完全指南
- hadoop基本操作
- Unable to add window -- token null is not for an application