NYCPHP Meetup

[nycphp-talk] OT Javascript Question

Andrew Yochum andrew at digitalpulp.com
Mon Aug 4 15:58:01 EDT 2003


On Mon, Aug 04, 2003 at 11:30:34AM -0400, Daniel Kushner wrote:
> To all those JS gurus out there (Krook!),
> 
> Is there a way to get the HTML source of a page into a javascipt variable
> (on the same page)?

Something like this should do it:
    try {
        // For IE
        htmlsource = document.body.innerHTML
    } catch (e) {
        // For Mozilla et. all
        htmlsource = document.body.value
    }

> 
> Thanks,
> Daniel

-- 
Andrew Yochum
Digital Pulp, Inc.
212.679.0676x255
andrew at digitalpulp.com



More information about the talk mailing list