[thelist] Can't view source in IE6

Danny Goodman dannyg at dannyg.com
Fri Sep 20 12:32:01 CDT 2002

If you just want to check a global variable value ad hoc, you can use a
quick-and-dirty javascript: URL in the Address/Location box:

javascript: void alert(someGlobalVarName)

Or for a hidden input value:

javascript: void alert(document.formName.elementName.value)

Another technique I use to get the current source code of the entire page
(including any post-loading, dynamically-generated HTML that wouldn't show
up in the source view) is to grab the entire HTML inside the <html> tag set.
While the current page goes away in the process, you get a selectable,
copyable readout of the current HTML state of the page for viewing in your
text editor. The following works in IE5+ and NN6+:

javascript: "<textarea cols=120 rows=40>" +
document.body.parentNode.innerHTML + "</textarea>"

Adjust the element starting point to narrow down to a specific part of the
document if needed. Or fill it out with additional code to put the textarea
into a separate window. Put the URL into a bookmarklet for use anytime.

[DHTMLTDR2 Now Shipping]

> All I want to do is check a frikkin' order code!

More information about the thelist mailing list