JS获取网站状态码,若网站存在,写入TXT文件,适用于IE. <script> //写文件 function writeFile(filename,filecontent){ var fso, f, s ; fso = new ActiveXObject("Scripting.FileSystemObject"); f = fso.OpenTextFile(filename,8,true); …
//js获取网站根路径(站点及虚拟目录),获得网站的根目录或虚拟目录的根地址 function getRootPath(){ var strFullPath=window.document.location.href; var strPath=window.document.location.pathname; var pos=strFullPath.indexOf(strPath); var prePath=strFull…
//js获取项目根路径,如: http://localhost:8083/uimcardprj function getRootPath(){ //获取当前网址,如: http://localhost:8083/uimcardprj/share/meun.jsp var curWwwPath=window.document.location.href; //获取主机地址之后的目录,如: uimcardprj/share/meun.jsp var pathName=window.document.…
var http=require('http') var url=require('url') var qs=require('querystring') http.createServer(onRequest).listen(3000) function onRequest(res,resp) { //第一种方式queryString模块的方式获取参数的方法 var arg=url.parse(res.url).query ; var nameValue=qs.parse(arg)['name…