Sponsors

 
Showing posts with label Document Object Model. Show all posts
Showing posts with label Document Object Model. Show all posts

Thursday, August 23, 2007

Exploring the iPhone Safari DOM

You may recall my post about how neat it would be if someone would write a tool to explore the iPhone's DOM sort of like done on BrainJar.com. My idea was to use Ajax to display the information on a regular sized monitor. Nice idea. But new code needs to be written.

All of a sudden I had an epiphany. If I didn't mind looking at the DOM on the iPhone's display, I could just go to the page Mike Hall created on his site and use it on my iPhone!

It worked!

Yes!
  • Put the following URL into your iPhone: http://brainjar.com/dhtml/domviewer/demo.html
  • Use your fingers to enlarge the page that comes up to a decent size.
  • Look on the page for the text: "The DOM Viewer can be used explore this page's document tree."
  • The word "document" will be in a slightly different font.
  • Tap the word "document" with your finger.
  • A new window will open up in the browser showing you the DOM tree!
  • Use your fingers to zoom this output to a readable size.
  • Go crazy discovering new interesting stuff about iPhone Safari!

Thanks Mike Hall for creating such a useful tool!

Note: you may have to tap links more than once to get them to work.

Tuesday, August 7, 2007

Thoughts on Traversing the iPhone Safari DOM

This thought provoking page reveals an exploration of the DOM in the iPhone Safari web browser. There is mention of using the Dojo debug statement to do this. This page made me think of something on BrainJar.com which enumerates through all the objects in the DOM and displays the hierarchy for you. My thought is to write something like this which uses Ajax to send back to the server this info and then have another page which displays the results. This results page would be viewed on a regular sized screen hooked up to a PC rather than the iPhone display. One could expand/collapse items in a tree view of the DOM and explore what's there. Anyone working on such a thing?

What's very cool to me is that running the viewer in IE on my PC, it exposes a list of events that my browser supports. Can this be done with the iPhone? Once these events are "discovered," one could write a test page using these events and see what happens when doing X or Y on the page.

To be honest, I'm really not interested right now in how it compares with other browsers or devices. I just want to know that for the iPhone, it works thus-and-thus.