欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

有一段获取当前ie的html的js代码,请教怎么转化为vbs代码?谢谢

更新时间: 2014-01-05 01:52:45 责任编辑: Author_N1

 

有一段获取当前IE的HTML的JS代码,请问如何转化为VBS代码?多谢 !
后面将结果输出到窗口中的部分不用管。感谢!~
VB code
<script language="JavaScript" defer>
<!--
// specific to context menu extensions
var win = external.menuArguments;

// the document object the user right-clicked on
var doc = win.document;

// the html string composing most of the document (everything inside the <HTML></HTML> tags
var szsource = "";
szsource = doc.documentElement.outerHTML;

// make sure our debugging window is a unique window
var wincounter = 0;

var mywin = window.open("about:blank", "fullsource" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes");
while (mywin == null) {
    mywin = window.open("about:blank", "fullsource" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes");
} // if (mywin == null)

var myDoc = mywin.document;

myDoc.open("text/plain");
myDoc.write(szsource);
myDoc.close();
myDoc.title = "Full Source for: " + win.location.href;
// -->


--参考方法--
未测试
VBScript code
win = external.menuArguments

' the document object the user right-clicked on
doc = win.document

' the html string composing most of the document (everything inside the <HTML></HTML> tags
szsource = ""
szsource = doc.documentElement.outerHTML

' make sure our debugging window is a unique window
wincounter = 0

mywin = window.open("about:blank", "fullsource" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes")
while mywin = null
    mywin = window.open("about:blank", "fullsource" + wincounter++, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes")
wend ' if mywin = null

myDoc = mywin.document

call myDoc.open("text/plain")
call myDoc.write(szsource)
call myDoc.close()
myDoc.title = "Full Source for: " + win.location.href

--参考方法--
再修改了一下,没有测试
VBScript code
win = external.menuArguments

' the document object the user right-clicked on
doc = win.document

' the html string composing most of the document (everything inside the <HTML></HTML> tags
szsource = ""
szsource = doc.documentElement.outerHTML

' make sure our debugging window is a unique window
wincounter = 0

mywin = window.open("about:blank", "fullsource" + wincounter, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes")
wincounter = wincounter + 1

while mywin = null
    mywin = window.open("about:blank", "fullsource" + wincounter, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes")
    wincounter = wincounter + 1
wend ' if mywin = null

myDoc = mywin.document

call myDoc.open("text/plain")
call myDoc.write(szsource)
call myDoc.close()
myDoc.title = "Full Source for: " + win.location.href 			
			
		
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 01:52:45
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/2437/
本文WWW.DOC100.NET DOC100.NET版权所有。