473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Best JavaScript DOM Inspector (Browser)

Hi

Just wondering if anybody can recommend the best JavaScript based DOM
browser / inspector?

Like those ones:

http://www.informatrix.ch/joe/joe.html
http://javascript.internet.com/page-...m-browser.html

Thank you.

Jul 23 '05 #1
6 2189
Alex Vassiliev wrote:
Hi

Just wondering if anybody can recommend the best JavaScript based DOM
browser / inspector?

Like those ones:

http://www.informatrix.ch/joe/joe.html
http://javascript.internet.com/page-...m-browser.html


Just curious - what benefit does a JavaScript-based DOM inspector have
over one that is available for free as a browser extension?
--
Rob
Jul 23 '05 #2
RobG wrote:
Just curious - what benefit does a JavaScript-based DOM inspector have
over one that is available for free as a browser extension?


.... which might also be JavaScript based :-)
Jul 23 '05 #3
All regular benefits of web application:
(1) easy to deploy with my application
(2) multiple browsers compatibility

Plus, if source code is available, I can invoke it from my js
application when it is exactly in the state I wanted to inspect plus I
can pass the reference to the exact object I wanted to inspect.
RobG wrote:
Alex Vassiliev wrote:
Hi

Just wondering if anybody can recommend the best JavaScript based DOM
browser / inspector?

Like those ones:

http://www.informatrix.ch/joe/joe.html
http://javascript.internet.com/page-...m-browser.html


Just curious - what benefit does a JavaScript-based DOM inspector have
over one that is available for free as a browser extension?
--
Rob


Jul 23 '05 #4
Alex Vassiliev wrote:
All regular benefits of web application:
(1) easy to deploy with my application
(2) multiple browsers compatibility

Plus, if source code is available, I can invoke it from my js
application when it is exactly in the state I wanted to inspect plus I
can pass the reference to the exact object I wanted to inspect.

[...]

Here is a 'DOMwalk' script I wrote some time ago as a quick 'n dirty
tree dump. If you give domReport() an id it will walk down from there.
If no id is given, it starts from the html element. I've tested it in
most modern browsers and it seems to be fine.

Everything is listed in a table with a node reference, with a bit of
effort a better presentation is possible. Nodes could be listed as <li>
elements and each parent node could have an associated <ul> element with
an onclick that collapses the branch. Node attributes could be in a
<span> beneath each node and be shown/hidden when the node is clicked on.

I had intentions of doing at least some of the above, but it seemed
pointless given that a perfectly serviceable DOM inspector comes free
with Geko browsers (there are probably some for other browsers too but I
haven't bothered to look).

Let me know if you want the above functionality added.
--
Rob
Jul 23 '05 #5
RobG wrote:
Alex Vassiliev wrote:
All regular benefits of web application:
(1) easy to deploy with my application
(2) multiple browsers compatibility

Plus, if source code is available, I can invoke it from my js
application when it is exactly in the state I wanted to inspect plus I
can pass the reference to the exact object I wanted to inspect.

[...]

Here is a 'DOMwalk' script I wrote some time ago as a quick 'n dirty
tree dump. If you give domReport() an id it will walk down from there.
If no id is given, it starts from the html element. I've tested it in
most modern browsers and it seems to be fine.

[...]
And here's the script... :-x
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title> DOMwalk </title>
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
var rpt = [];
function domWalk(n,x) {
rpt.push('<tr><td>' + x
+ '</td><td>' + n.nodeName
+ '</td><td>' + n.nodeType
+ '</tr>');
for (var i=0; i<n.childNodes.length; i++) {
domWalk(n.childNodes[i],x+'.'+i);
}
}

function domReport(s){
rpt.length = 0;
rpt.push('<table><tr><th>Index</th>'
+ '<th>nodeName</th><th>nodeType</th></tr>');
if ( s && '' != s) {
domWalk(document.getElementById(s),'');
} else {
domWalk(document.getElementsByTagName('html')[0],'0');
}
rpt.push('</table>');
document.getElementById('xx').innerHTML = rpt.join('');
}
</script>
</head>
<body onload="domReport();">

<div>
<p>this stuff is just so that there is something
in the document to report on.</p>
<p>Here is <b>some</b> text</p>
<p>Here is <b>some</b> <i>text</i></p>
<p>Here is some text</p>
</div>

<div id="xx"></div>

</body>
</html>
--
Rob
Jul 23 '05 #6
I was thinking more about JS object members browser. Something you can
use to inrospect the available properties and methods of given class.
Plust the ability to jump (chenge the focus) on the references, etc.

There are DOM browsers like this one:
http://slayeroffice.com/?c=/content/tools/suite.html
or
javascript:s=document.body.appendChild(document.cr eateElement('script'));s.id='fs';s.language='javas cript';void(s.src='http://slayeroffice.com/tools/suite/suite.js');

which will let you browse the DOM, but not the pure JS object graph.

But thnank for your example anyway... I guess I can modify it like this
to achive my desired results:
function domWalk(n,x) {
var members = '';
for(var m in n) members += m+';';
rpt.push('<tr><td>' + x
+ '</td><td>' + n.nodeName
+ '</td><td>' + n.nodeType
+ '</td><td>' + members
+ '</tr>');
for (var i=0; i<n.childNodes.length; i++) {
domWalk(n.childNodes[i],x+'.'+i);
}
}

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bruce W.1 | last post by:
Can anyone recommend a Javascript debugger? I see where debuggers are made by Netscape, Microsoft and Macromedia (built-in to Dreamweaver). I'm new to javascript so any comments are appreciated....
4
by: ÂÑTØÑ | last post by:
Hi, I was looking for a list of commands, but I can't find it. It's about commands you can type in the Internet Explorer adress bar, to get some information about a website. For instance...
13
by: Craig | last post by:
Hey all, Here's the situation: - two websites, one on domain1 and the other on domain2 - domain1 opens a new window which is a javascript app from domain2 - domain1 needs to communicate with...
14
by: Jeff Papineau | last post by:
http://www.mandala.com/javascript/debug_javascript.html I've written up a page explaining how to use the MS Script Editor for Javascript debugging in IE. It's a great debugging environment and...
2
by: Praveen Ramesh | last post by:
Hi, I just started writing a lot of script code in JavaScript (accessing browser DOM basically) and coming from the C#-VS.Net background, I just hate it. There is no true class definition...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
19
by: maya | last post by:
hi, so what is "modern" javascript?? the same as "DOM-scripting"? i.e., editing content (or changing appearance of content) dynamically by massaging javascript objects, html elements, etc? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.