How to View the Dynamic HTML Source
Dflying | 10 March, 2006 20:07Developing and debugging AJAX apps can be very tricky. The AJAX technology went on relatively soon while the development tools are slow and still catching up, so you do need to use a bag of neat tricks AND dirty/ugly hacks to see what is really going on. The first problem for beginners is where is the HTML output I wrote to the page?
Just select "View Source" from the browser and take a look at the notepad codes? Got the generated Html? Of course, in AJAX world, things are never that easy (This should become a common sense for AJAX developer). "View Source" actually returns the source of the original page, which is also what you get form the HTTP server - any JavaScript / DOM modifications after the AJAX request are not visible. What do we do now if we want to see the current Html dump?
- IE: Use this clever hack to return the current state of the page - typing "javascript:'<xmp>' + window.document.body.outerHTML+ '</xmp>'" in the address bar should do the trick.
- FireFox: Use this neat FireFox extension to view the "Generated Source" instead of plain "View Source".
Hmmm, thinking of the first experience of your programming life: you typed a “hello world” in the IDE and press F5, a window popped up showing the outputs. Simple and easy. But now… Remember you just wanna see the output. Anyway, it works.
Posted in
JavaScript & AJAX.
Comment: (0).
Trackbacks:(92).
Permalink
«Next post |
Previous post»




