当前位置: 代码迷 >> vbScript >> 有一段获取当前IE的HTML的JS代码,请教怎么转化为VBS代码?谢谢
  详细解决方案

有一段获取当前IE的HTML的JS代码,请教怎么转化为VBS代码?谢谢

热度:5231   发布时间:2013-02-26 00:00:00.0
有一段获取当前IE的HTML的JS代码,请问如何转化为VBS代码?多谢 !
后面将结果输出到窗口中的部分不用管。感谢!~
VB code
<script language="JavaScript" defer><!--// specific to context menu extensionsvar win = external.menuArguments;// the document object the user right-clicked onvar doc = win.document;// the html string composing most of the document (everything inside the <HTML></HTML> tagsvar szsource = "";szsource = doc.documentElement.outerHTML;// make sure our debugging window is a unique windowvar 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 ondoc = win.document' the html string composing most of the document (everything inside the <HTML></HTML> tagsszsource = ""szsource = doc.documentElement.outerHTML' make sure our debugging window is a unique windowwincounter = 0mywin = 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 = nullmyDoc = mywin.documentcall 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 ondoc = win.document' the html string composing most of the document (everything inside the <HTML></HTML> tagsszsource = ""szsource = doc.documentElement.outerHTML' make sure our debugging window is a unique windowwincounter = 0mywin = window.open("about:blank", "fullsource" + wincounter, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes")wincounter = wincounter + 1while mywin = null    mywin = window.open("about:blank", "fullsource" + wincounter, "toolbar=no,location=no,menubar=yes,status=yes,scrollbars=yes,resizable=yes")    wincounter = wincounter + 1wend ' if mywin = nullmyDoc = mywin.documentcall myDoc.open("text/plain")call myDoc.write(szsource)call myDoc.close()myDoc.title = "Full Source for: " + win.location.href
  相关解决方案