首页 > 编程 > HTML > 正文

DOM浏览器(方便需要dom操作的朋友)

2024-08-26 00:15:43
字体:
来源:转载
供稿:网友

Open a folder view, launch this application, click on init, it detects all instances. Just drill-down to see the properties of the objects recursively.
You can now update properties and invoke methods on running instances !

File Name : DOM_Explorer.hta
Requirement : IE 5.5 (not tested on IE5.1)
Author : Jean-Luc Antoine
Submitted : 31/10/2001
Updated : 19/11/2001
Category : HTA
Remember : The file extension has to be *.HTA

代码如下:
<html>
<head>
<title>Dom Explorer</title>
<HTA:APPLICATION
 APPLICATIONNAME="Dom_Explorer"
 BORDER="thick" BORDERSTYLE="normal"
 CAPTION="yes" CONTEXTMENU="yes"
 ID="oHTA" alert(oHTA.applicationName);
 INNERBORDER="yes" MAXIMIZEBUTTON="yes" MINIMIZEBUTTON="yes"
 NAVIGABLE="no" SCROLL="yes" SCROLLFLAT="no"
 SELECTION="yes" SHOWINTASKBAR="yes" SINGLEINSTANCE="no"
 SYSMENU="yes" VERSION="0.5" WINDOWSTATE="normal">
<script language=vbscript>
option explicit
dim shApp
set shApp=createobject("shell.application")

Function SP2(name,obj,RW,ObjPath) 'Properties
 Dim Chaine
 Chaine="<TR><TD>"
 If isobject(obj) Then
  If obj is Nothing Then
   If HideNull.Checked Then
    SP2=""
    exit function
   End If
   Chaine=Chaine & Name
  ElseIf VarType(obj)=0 Then
   Chaine=Chaine & Name
  Else
   Chaine=Chaine & "<a href=""#"" OnClick='vbscript:ShowProp " &_
   ObjPath & "." & name & ",""" & ObjPath & "." & name &_
   """' title='" & ObjPath & "." & name & "'>" & name & "</a>"
  End If
 Else
  Chaine=Chaine & Name
 End If
 Chaine=Chaine & "</TD><TD>" & typeName(obj) & "</TD><TD>" & RW & "</TD><TD>"

 Select Case VarType(Obj)
 Case 0 'Empty
  Chaine=Chaine & "<font color=red>Uninitialized</font>"
 Case 1 'Null 'If IsNull(Obj) Then
  If HideNull.Checked Then
   SP2=""
   exit function
  End If
  Chaine=Chaine & "<font color=red>No value</font>"
 Case 9 'Object
  Chaine=Chaine & "<font color=red>Can't display</font>"
 Case Else
  If RW="Read/Write" Then
   Chaine=Chaine & "<span ID=""" & name & """ contenteditable=true><b>" &_
     Replace(obj,"<","<") & "</b></span> <a href='#' onclick='vbscript:" &_
      ObjPath & "." & name & "="
   Select Case VarType(Obj)
   'Case 2 'vbInteger - CInt()
   'Case 3 'vbLong - CLng()

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表