div like iframe?

D

DS

Is there any way to get a <div> or a <span> to act like an iframe in the
sense that you can specify a source html file for it? For example, would it
be possible to say <div src="http://www.xyz.com/banner.html"> or something
similar so that it can be updated via javascript?

Thanks in advance,
Dan
 
M

Mark Parnell

Sometime around Fri, 03 Oct 2003 02:33:51 GMT, DS is reported to have
stated:
Is there any way to get a <div> or a <span> to act like an iframe in the
sense that you can specify a source html file for it? For example, would it

No, that's what iframes are for. But depending on what you are trying to
achieve, there is probably a better way.

http://www.allmyfaqs.com/faq.pl?Include_one_file_in_another
be possible to say <div src="http://www.xyz.com/banner.html"> or something
similar so that it can be updated via javascript?

And degrade nicely for users without Javascript, of course. :)
 
D

DS

Mark Parnell said:
Sometime around Fri, 03 Oct 2003 02:33:51 GMT, DS is reported to have
stated:
it

No, that's what iframes are for. But depending on what you are trying to
achieve, there is probably a better way.

http://www.allmyfaqs.com/faq.pl?Include_one_file_in_another


And degrade nicely for users without Javascript, of course. :)

Actually I was wanting to create a client side Javascript like applet to
implement a custom tabs type interface for Netscape/IE/mozilla browsers. The
idea is that it will store minimal stuff on a server (like
bookmarks/history), but I dont want to have to use the server to "scrape"
each page and display it. Its mainly so that I and others can access
bookmarks and such at school/work/etc, and also add some other tweaks to
help development and doing projects.

Thanks
 
T

Toby A Inkster

DS said:
Is there any way to get a <div> or a <span> to act like an iframe in the
sense that you can specify a source html file for it? For example, would it
be possible to say <div src="http://www.xyz.com/banner.html"> or something
similar so that it can be updated via javascript?

There will be in XHTML2.
 
W

Whitecrest

@news01.bloor.is.net.cable.rogers.com>, (e-mail address removed)
says...
Is there any way to get a <div> or a <span> to act like an iframe in the
sense that you can specify a source html file for it? For example, would it
be possible to say <div src="http://www.xyz.com/banner.html"> or something
similar so that it can be updated via javascript?

Yes, if you use XMLhttp, and innerhtml, you can make a div act exactly
like an iframe. (I have not tried cross domain, there may be some
security issues with that)

Of course, you have to take into consideration that there will be some
people that will not see it right for one reason or another. I do not
think Opera knows how to deal with XMLhttp, nd then you have the anti-
javascript people who won't see it either.
 
K

Kris

Is there any way to get a <div> or a <span> to act like an iframe in the
sense that you can specify a source html file for it? For example, would it
be possible to say <div src="http://www.xyz.com/banner.html"> or something
similar so that it can be updated via javascript?

Yes, if you use XMLhttp, and innerhtml, you can make a div act exactly
like an iframe. (I have not tried cross domain, there may be some
security issues with that)

Of course, you have to take into consideration that there will be some
people that will not see it right for one reason or another. I do not
think Opera knows how to deal with XMLhttp, nd then you have the anti-
javascript people who won't see it either.[/QUOTE]

All people who use IE/Win (6+?) with Javascript enabled can benefit from
this function. All others can't. Is this accurate?
 
W

Whitecrest

All people who use IE/Win (6+?) with Javascript enabled can benefit from
this function. All others can't. Is this accurate?

Yes for the most part, I am sure someone can think up some obscure
scenario where it would not work. But remember the Domain issue too. If
the pages you want to appear in the div at your site, you are in good
shape.
 

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,815
Messages
2,569,705
Members
45,494
Latest member
KandyFrank

Latest Threads

Top