DHTML question: DOM access in <object type="text/html" data="..."> ??

Discussion in 'HTML' started by Jon Davis, Dec 17, 2004.

  1. Jon Davis

    Jon Davis Guest

    I recently learned how to do client-side includes in current browsers using:

    <object id="extendedhtml" type="text/html" data="otherpage.html" width="250"
    height="400"></object>

    My question is how do I access the document DOM of this object in
    Javascript? For example, "alert(extendedhtml.innerHTML);" doesn't work and
    produces an unknown error. I'd like to both read and write to the document's
    body element's innerHTML property, as well as access its full DOM (forms,
    etc) as I would access the elements of the main page.

    Thanks,
    Jon
     
    Jon Davis, Dec 17, 2004
    #1
    1. Advertising

  2. Jon Davis

    SpaceGirl Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    Jon Davis wrote:
    > I recently learned how to do client-side includes in current browsers using:
    >
    > <object id="extendedhtml" type="text/html" data="otherpage.html" width="250"
    > height="400"></object>
    >
    > My question is how do I access the document DOM of this object in
    > Javascript? For example, "alert(extendedhtml.innerHTML);" doesn't work and
    > produces an unknown error. I'd like to both read and write to the document's
    > body element's innerHTML property, as well as access its full DOM (forms,
    > etc) as I would access the elements of the main page.
    >
    > Thanks,
    > Jon
    >
    >


    That is NOT the way to do includes. Include your stuff server side instead;

    Under IIS (Windows server):

    <!-- #include file="myfile.htm" //-->


    --

    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
     
    SpaceGirl, Dec 17, 2004
    #2
    1. Advertising

  3. Jon Davis

    Dylan Parry Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    SpaceGirl wrote:

    > Under IIS (Windows server):
    > <!-- #include file="myfile.htm" //-->


    and of course with PHP it is:

    <?php include("myfile.htm"); ?>

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 17, 2004
    #3
  4. Jon Davis

    Jon Davis Guest

    I said CLIENT-side includes. I've been doing SERVER-side includes since
    1997.

    You didn't answer my DHTML-related question. This is alt.html, not alt.iis
    nor alt.php.

    Jon


    "SpaceGirl" <> wrote in message
    news:...
    > Jon Davis wrote:
    > > I recently learned how to do client-side includes in current browsers

    using:
    > >
    > > <object id="extendedhtml" type="text/html" data="otherpage.html"

    width="250"
    > > height="400"></object>
    > >
    > > My question is how do I access the document DOM of this object in
    > > Javascript? For example, "alert(extendedhtml.innerHTML);" doesn't work

    and
    > > produces an unknown error. I'd like to both read and write to the

    document's
    > > body element's innerHTML property, as well as access its full DOM

    (forms,
    > > etc) as I would access the elements of the main page.
    > >
    > > Thanks,
    > > Jon
    > >
    > >

    >
    > That is NOT the way to do includes. Include your stuff server side

    instead;
    >
    > Under IIS (Windows server):
    >
    > <!-- #include file="myfile.htm" //-->
    >
    >
    > --
    >
    > x theSpaceGirl (miranda)
    >
    > # lead designer @ http://www.dhnewmedia.com #
    > # remove NO SPAM to email, or use form on website #
     
    Jon Davis, Dec 17, 2004
    #4
  5. Jon Davis

    Jon Davis Guest

    Re: DHTML question: DOM access in <object type="text/html" data="..."> ??

    I said CLIENT-side includes. I've been doing SERVER-side includes since
    1997.

    You didn't answer my DHTML-related question. This is alt.html, not alt.iis
    nor alt.php.

    Jon


    "Dylan Parry" <> wrote in message
    news:...
    > SpaceGirl wrote:
    >
    > > Under IIS (Windows server):
    > > <!-- #include file="myfile.htm" //-->

    >
    > and of course with PHP it is:
    >
    > <?php include("myfile.htm"); ?>
    >
    > --
    > Dylan Parry
    > http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Jon Davis, Dec 17, 2004
    #5
  6. Jon Davis

    Jon Davis Guest

    And by the way I know all about <script src="..."> with document.write's, so
    don't bother. I'm asking about <object> right now.

    Jon


    "Jon Davis" <> wrote in message
    news:...
    > I said CLIENT-side includes. I've been doing SERVER-side includes since
    > 1997.
    >
    > You didn't answer my DHTML-related question. This is alt.html, not alt.iis
    > nor alt.php.
    >
    > Jon
    >
    >
    > "SpaceGirl" <> wrote in message
    > news:...
    > > Jon Davis wrote:
    > > > I recently learned how to do client-side includes in current browsers

    > using:
    > > >
    > > > <object id="extendedhtml" type="text/html" data="otherpage.html"

    > width="250"
    > > > height="400"></object>
    > > >
    > > > My question is how do I access the document DOM of this object in
    > > > Javascript? For example, "alert(extendedhtml.innerHTML);" doesn't work

    > and
    > > > produces an unknown error. I'd like to both read and write to the

    > document's
    > > > body element's innerHTML property, as well as access its full DOM

    > (forms,
    > > > etc) as I would access the elements of the main page.
    > > >
    > > > Thanks,
    > > > Jon
    > > >
    > > >

    > >
    > > That is NOT the way to do includes. Include your stuff server side

    > instead;
    > >
    > > Under IIS (Windows server):
    > >
    > > <!-- #include file="myfile.htm" //-->
    > >
    > >
    > > --
    > >
    > > x theSpaceGirl (miranda)
    > >
    > > # lead designer @ http://www.dhnewmedia.com #
    > > # remove NO SPAM to email, or use form on website #

    >
    >
     
    Jon Davis, Dec 17, 2004
    #6
  7. Jon Davis

    Jon Davis Guest

    And by the way I know all about <script src="..."> with document.write's,
    and I know about <IFRAME>, so
    don't bother. I'm asking about <object> right now.

    Jon

    "Jon Davis" <> wrote in message
    news:...
    > I said CLIENT-side includes. I've been doing SERVER-side includes since
    > 1997.
    >
    > You didn't answer my DHTML-related question. This is alt.html, not alt.iis
    > nor alt.php.
    >
    > Jon
    >
    >
    > "SpaceGirl" <> wrote in message
    > news:...
    > > Jon Davis wrote:
    > > > I recently learned how to do client-side includes in current browsers

    > using:
    > > >
    > > > <object id="extendedhtml" type="text/html" data="otherpage.html"

    > width="250"
    > > > height="400"></object>
    > > >
    > > > My question is how do I access the document DOM of this object in
    > > > Javascript? For example, "alert(extendedhtml.innerHTML);" doesn't work

    > and
    > > > produces an unknown error. I'd like to both read and write to the

    > document's
    > > > body element's innerHTML property, as well as access its full DOM

    > (forms,
    > > > etc) as I would access the elements of the main page.
    > > >
    > > > Thanks,
    > > > Jon
    > > >
    > > >

    > >
    > > That is NOT the way to do includes. Include your stuff server side

    > instead;
    > >
    > > Under IIS (Windows server):
    > >
    > > <!-- #include file="myfile.htm" //-->
    > >
    > >
    > > --
    > >
    > > x theSpaceGirl (miranda)
    > >
    > > # lead designer @ http://www.dhnewmedia.com #
    > > # remove NO SPAM to email, or use form on website #

    >
    >
     
    Jon Davis, Dec 17, 2004
    #7
  8. Jon Davis

    Dylan Parry Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    Jon Davis wrote:
    > I said CLIENT-side includes. I've been doing SERVER-side includes since
    > 1997.


    Good for you.

    > You didn't answer my DHTML-related question. This is alt.html, not alt.iis
    > nor alt.php.


    Exactly. It's not alt.html.dhtml either. You might have asked a
    question, which as unpaid folk we are under no obligation to answer in
    any way. What SpaceGirl did was point out how poor client-side includes
    are and offered an alternative. What you did was have a hissy fit.

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 17, 2004
    #8
  9. Jon Davis

    SpaceGirl Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    Jon Davis wrote:
    > And by the way I know all about <script src="..."> with document.write's,
    > and I know about <IFRAME>, so
    > don't bother. I'm asking about <object> right now.
    >
    > Jon


    Okay, I wont bother then. This isn't a helpdesk. Take a long walk.

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
     
    SpaceGirl, Dec 17, 2004
    #9
  10. Jon Davis

    Jon Davis Guest

    Re: DHTML question: DOM access in <object type="text/html" data="..."> ??

    > What SpaceGirl did was point out how poor client-side includes
    > are


    No she didn't. Nor do I care.

    > and offered an alternative.


    I know the alternative. I don't care about it. I didn't ask about anyone's
    take on whether this is the right kind of include. I asked how to access
    the HTML DOM of an <object> tag that references an external document.

    Server-side includes are nice and all, but don't do isolated server
    processing. <script src"..."> can help, but a zillion document.writes are no
    fun.

    > What you did was have a hissy fit.


    Indeed, because she and you are completely wasting my time; welcome to my
    killfile.

    Does anyone know how to access the DOM of an <object> tag that references an
    external document? Thanks ahead of time.

    Jon



    "Dylan Parry" <> wrote in message
    news:...
    > Jon Davis wrote:
    > > I said CLIENT-side includes. I've been doing SERVER-side includes since
    > > 1997.

    >
    > Good for you.
    >
    > > You didn't answer my DHTML-related question. This is alt.html, not

    alt.iis
    > > nor alt.php.

    >
    > Exactly. It's not alt.html.dhtml either. You might have asked a
    > question, which as unpaid folk we are under no obligation to answer in
    > any way. What SpaceGirl did was point out how poor client-side includes
    > are and offered an alternative. What you did was have a hissy fit.
    >
    > --
    > Dylan Parry
    > http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Jon Davis, Dec 17, 2004
    #10
  11. Re: DHTML question: DOM access in <object type="text/html" data="..."> ??

    On Fri, 17 Dec 2004 04:54:04 -0800, Jon Davis <>
    wrote:

    > Indeed, because she and you are completely wasting my time; welcome to my
    > killfile.
    >


    Hang on you, top posting and all. This is usenet, not a helpdesk.

    Curtousy of Mark Parnell, since I've not seen it said better, nor could I
    put it better myself:
    "This is Usenet. It is a discussion group, not a helpdesk. You post
    something, we discuss it. If you have a question and that happens to get
    answered in the course of the discussion, then great. If not, you can
    have a full refund of your membership fees."[1]

    [1]
    <http://groups.google.com/groups?selm=pr25ludwho5r$.1vroro2rvwbk$>

    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 17, 2004
    #11
  12. Jon Davis

    Dylan Parry Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    Jon Davis wrote:

    > Indeed, because she and you are completely wasting my time; welcome to my
    > killfile.


    Fine by me. I couldn't give a toss about your killfile.

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 17, 2004
    #12
  13. Jon Davis

    Jon Davis Guest

    Re: DHTML question: DOM access in <object type="text/html" data="..."> ??

    "Barbara de Zoete" <> wrote in message
    news:eek:psi5k3s1ex5vgts@zoete_b...
    > Hang on you, top posting and all. This is usenet, not a helpdesk.


    Hmm somebody just said that ... *plonk* again, this is starting to get fun
    again ... been a while ...

    So does anyone know how to access the DOM of a document-referencing <OBJECT>
    tag? :)

    Jon
     
    Jon Davis, Dec 17, 2004
    #13
  14. Jon Davis

    Dylan Parry Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    Jon Davis wrote:

    > Hmm somebody just said that ... *plonk* again


    Well with the way this chap is going, there won't be any regulars left
    to /help/ him anyway! I wonder what his response will be when some of
    the less patient regulars reply?

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 17, 2004
    #14
  15. Re: DHTML question: DOM access in <object type="text/html" data="..."> ??

    On Fri, 17 Dec 2004 13:12:07 +0000, Dylan Parry <>
    wrote:

    > Jon Davis wrote:
    >
    >> Hmm somebody just said that ... *plonk* again

    >
    > Well with the way this chap is going, there won't be any regulars left
    > to /help/ him anyway! I wonder what his response will be when some of
    > the less patient regulars reply?
    >


    :-D When? Assuming they will reply? I would make that _if_ ;-)

    --
    Weblog | <http://home.wanadoo.nl/b.de.zoete/_private/weblog.html>
    Webontwerp | <http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html>
    Zweefvliegen | <http://home.wanadoo.nl/b.de.zoete/html/vliegen.html>
     
    Barbara de Zoete, Dec 17, 2004
    #15
  16. Jon Davis

    SpaceGirl Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    Barbara de Zoete wrote:
    > On Fri, 17 Dec 2004 13:12:07 +0000, Dylan Parry <>
    > wrote:
    >
    >> Jon Davis wrote:
    >>
    >>> Hmm somebody just said that ... *plonk* again

    >>
    >>
    >> Well with the way this chap is going, there won't be any regulars
    >> left to /help/ him anyway! I wonder what his response will be when
    >> some of the less patient regulars reply?
    >>

    >
    > :-D When? Assuming they will reply? I would make that _if_ ;-)
    >


    I seriously doubt any with bother helping him now. What a dickhead! :)
    Shame really, because I did a bit of digging and I think I found a solution.

    --


    x theSpaceGirl (miranda)

    # lead designer @ http://www.dhnewmedia.com #
    # remove NO SPAM to email, or use form on website #
     
    SpaceGirl, Dec 17, 2004
    #16
  17. Re: DHTML question: DOM access in <object type="text/html" data="..."> ??

    On Fri, 17 Dec 2004 13:16:47 +0000, SpaceGirl
    <> wrote:

    [snip]

    > I seriously doubt any with bother helping him now. What a dickhead! :)
    > Shame really, because I did a bit of digging and I think I found a
    > solution.


    Same here, though the OP didn't say what environment this is supposed to
    work in - that affects what should be used.

    Mike

    --
    Michael Winter
    Replace ".invalid" with ".uk" to reply by e-mail.
     
    Michael Winter, Dec 17, 2004
    #17
  18. Jon Davis

    Philip Ronan Guest

    Re: DHTML question: DOM access in <object type="text/html"data="..."> ??

    Jon Davis wrote:

    >
    > "Barbara de Zoete" <> wrote in message
    > news:eek:psi5k3s1ex5vgts@zoete_b...
    >> Hang on you, top posting and all. This is usenet, not a helpdesk.

    >
    > Hmm somebody just said that ... *plonk* again, this is starting to get fun
    > again ... been a while ...
    >
    > So does anyone know how to access the DOM of a document-referencing <OBJECT>
    > tag? :)
    >
    > Jon
    >
    >


    extendedhtml.document.body.innerHTML

    Merry Xmas ~<:)

    --
    phil [dot] ronan @ virgin [dot] net
    http://vzone.virgin.net/phil.ronan/
     
    Philip Ronan, Dec 17, 2004
    #18
  19. Jon Davis

    Karl Core Guest

    Re: DHTML question: DOM access in <object type="text/html" data="..."> ??

    "Jon Davis" <> wrote in message
    news:...
    >
    > "Barbara de Zoete" <> wrote in message
    > news:eek:psi5k3s1ex5vgts@zoete_b...
    >> Hang on you, top posting and all. This is usenet, not a helpdesk.

    >
    > Hmm somebody just said that ... *plonk* again, this is starting to get fun
    > again ... been a while ...
    >
    > So does anyone know how to access the DOM of a document-referencing
    > <OBJECT>
    > tag? :)


    Yes. But they're not going to tell you because you're acting like an
    asshole.
    Don't act like a dick to people and then expect them to help you. For free,
    no less. It doesn't work that way.

    Please killfile me, too.


    --
    -Karl Core
    Please Support "Project Boneyard":
    http://www.insurgence.net/info.aspx?action=band&item=boneyard
     
    Karl Core, Dec 17, 2004
    #19
  20. Jon Davis

    Dylan Parry Guest

    Re: DHTML question: DOM access in <object type="text/html" data="...">??

    Karl Core wrote:

    > Yes. But they're not going to tell you because you're acting like an
    > asshole.


    See! I knew one of the less-patient amongst us would reply. Karl can be
    relied upon not to have time for idiots, and for that he should be
    admired :D

    --
    Dylan Parry
    http://webpageworkshop.co.uk -- FREE Web tutorials and references
     
    Dylan Parry, Dec 17, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Skinny Guy
    Replies:
    0
    Views:
    906
    Skinny Guy
    Jun 10, 2004
  2. Replies:
    0
    Views:
    558
  3. angel
    Replies:
    4
    Views:
    3,298
    angel
    May 9, 2004
  4. mr_burns
    Replies:
    2
    Views:
    106
    Douglas Crockford
    Dec 22, 2004
  5. Steve
    Replies:
    1
    Views:
    287
    Richard Cornford
    Apr 9, 2005
Loading...

Share This Page