Forum Moderators: open

Message Too Old, No Replies

Loading HTML into a Div?

         

intherain

3:00 pm on Feb 18, 2005 (gmt 0)

10+ Year Member



Does anybody know how i can get an external html page which i have already styled to load into a div?

I tried using iframes at first but safari won't show the content if the size is a percentage rather than an actual pixel dimension. so a scrolling div seemed to be the answer....but im new to scrolling divs and dont know how to load in the html page!

Can anybody help?

Thanks

monkeythumpa

5:04 pm on Feb 18, 2005 (gmt 0)

10+ Year Member



<div id="that"><!--#include virtual="page.htm" --><div>

Search for include virtual for more info

zollerwagner

7:39 pm on Feb 18, 2005 (gmt 0)

10+ Year Member



Are you thinking of using another set of <html>, <body>, and related elements inside a <div>?

That might work in many browsers, but I don't think it will validate.

I think the iframe is propriety Microsoft, so it's not useful because not many browsers will support it.

The virtual includes are usually used with pieces of web pages. They are separate files, but usually not an entire web page, at least not as I use them.

Perhaps it would help if you describe what the function/purpose of this page is. Then we might come up with better ideas for you.

tedster

8:08 pm on Feb 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The inline frame or iframe element was introduced in HTML 4 [w3.org] and is part of the standard today. It wasn't supported by NN4 (rest in peace), but other than that, iframes are the way if you want to embed a full html document within a div.

And if NN4 still matters to you, there is a non-standard <ilayer> tag that it supports. Just nest the iframe within an ilayer and all recent browsers should be OK, although the ilayer does not validate.

Includes work well when you want to include HTML "snippets" but not a full document.

zollerwagner

8:41 pm on Feb 18, 2005 (gmt 0)

10+ Year Member



Wow, Tedster, I didn't realize inline frames had become standard! Amazing. I'd given up on them years ago.... Thanks for the correction.

intherain

10:09 am on Feb 21, 2005 (gmt 0)

10+ Year Member



Thanks for your replies so far. A little more info about my question....

I have an index page already set up which includes a flash menu, titles etc etc. I then want the main content of the website to load in to a frame on the index page.

It's only a small site and I have separate htm documents where the content is set out... separate tags for <html>, <body> etc.

When you select an option from the flash menu I want to content in the frame to change by loading the relevant htm document.

I've disabled scrollbars on the site. The only scrollbar I want to use is a scrollbar on the actual content frame. ie. I don't want to lose the menu and title when the user scrolls. This scrollbar will only appear/be necessary if the users resolution prevents all the content from being displayed in one view, hence why I need this frame to be sized as a percentage.

Hope this makes things clearer!

Thanks

zollerwagner

2:35 am on Feb 22, 2005 (gmt 0)

10+ Year Member



One of the conclusions arrived at in recent years in terms of web usability is that it's better to stick with conventions that your visitors will already understand unless there is a compelling reason to break with these norms. You're reinventing the wheel in several ways. There's no law against it, of course.

The question I'd ask myself is whether there is a good reason to make users figure out how your page works and good reason to risk alienating them.

tedster

4:23 am on Feb 22, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds like you have it all planned - I'm not sure what question is still unanswered.

If it's how to target the inline frame from a link, just give the iframe some matching attributes of name="somename" and id="somename", and then use an attribute of target="somename" on the link.

If it's how to place those links in a Flash menu, the folks in our Flash Forum [webmasterworld.com] should be able to help you the best.

If it's something I've missed, just ask.