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

J

Jon Davis

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
 
S

SpaceGirl

Jon said:
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 #
 
J

Jon Davis

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
 
J

Jon Davis

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
 
J

Jon Davis

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
 
J

Jon Davis

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
 
D

Dylan Parry

Jon said:
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.
 
S

SpaceGirl

Jon said:
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 #
 
J

Jon Davis

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

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
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
 
B

Barbara de Zoete

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/[email protected]>
 
J

Jon Davis

Barbara de Zoete said:
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
 
D

Dylan Parry

Jon said:
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?
 
B

Barbara de Zoete

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_ ;-)
 
S

SpaceGirl

Barbara said:
:-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 #
 
M

Michael Winter

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

[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
 
P

Philip Ronan

Jon said:
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 ~<:)
 
K

Karl Core

Jon Davis said:
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.
 
D

Dylan Parry

Karl said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top