8 replies [Last post]
Boersnoes
Offline
newbie
Belgium
Last seen: 17 years 6 weeks ago
Belgium
Joined: 2004-08-12
Posts: 2
Points: 0

As far as I get the concept of css now there is no need for tables/frames anymore.
But what with navigation?
When a users chooses a link to e.g. the contact page, this contact page has to include the navigation, the header and the footer again.

Is there no way (without using javascript) to only change the content of one DIV.

F.E.

<DIV id="navBar">
<ul>
   <li><a href="./index.html">home</a></li>
   <li><a href="./contact.html">contact</a></li>
</ul>
</div>
<div id="main">
   <div id="title">
       HOME
    </div>
    <div id="content">
       On this page you'll find some nice .. stuff
    </div>
</div>

If the users presses the "contact" link the WHOLE page has to be loaded. Is there no way that only the "title" and "content" DIV's get another content?

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Navigate without loading whole page every time?

Not really You could try an Iframe(slight shudder) for the content. Well written CSS/HTML is fast loading it shouldn't be a problem for the user.
If you have a lot of pages and the pain of updating menus etc then PHP includes/templates is quite a neat way of dealing with the issue (as long as your server supports it)

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

Boersnoes
Offline
newbie
Belgium
Last seen: 17 years 6 weeks ago
Belgium
Joined: 2004-08-12
Posts: 2
Points: 0

Navigate without loading whole page every time?

Thx.
I know the loading time isn't really the problem, but indeed, the problem of updating is a pain in the ass when for example the nav has to be updated in 10+ files.

What's the deal with those Iframes? (help a noob out Tongue)

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 6 years 36 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

Navigate without loading whole page every time?

Iframes will take a link to an external file but are a deprecated tag in xhtml strict so won't validate.
If it's a case of the pain of updating menus across pages I would have thought that a PHP include menu would be best, if your server supports PHP.

Hugo.

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 26 weeks 3 days ago
Joined: 2004-06-30
Posts: 9674
Points: 810

Navigate without loading whole page every time?

You could always use an iframe and the xhtml transitional doctype.

But PHP is probably a better way to go.

Verschwindende wrote:
  • CSS doesn't make pies

mAdMaLuDaWg
Offline
newbie
Last seen: 17 years 5 weeks ago
Joined: 2004-08-17
Posts: 3
Points: 0

Navigate without loading whole page every time?

If you could use ASP.NET, there is a feature called SmartNavigation that takes care of what exactly you want to do. Just set the SmartNavigation="True" in the page directive and you'll be set.

brockly
Offline
Regular
Kent England
Last seen: 17 years 5 weeks ago
Kent England
Joined: 2004-08-18
Posts: 22
Points: 0

I find the quickest way to do this is to use frames

<frameset rows="110,*,30" framespacing="0" frameborder=0 border=0>
	<frame name="top" scrolling="no" noresize target="main" src="header.htm" marginwidth="0" marginheight="0">
	<frameset cols="178," framespacing="0" frameborder=0 border=0>
		<frame name="main" src="home.htm" target="_self" scrolling="no">
	</frameset>
	<frame name="bottom" scrolling="no" noresize target="contents" src="footer.htm">
	<noframes>
	<body>

	<p>This page uses frames, but your browser doesn't support them.</p>
	
	</body>
	</noframes>
</frameset>

Then only the frame named main is changed if you put

<base target="main"> 

in the head section of your page,

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 26 weeks 3 days ago
Joined: 2004-06-30
Posts: 9674
Points: 810

Navigate without loading whole page every time?

Verschwindende wrote:
  • CSS doesn't make pies

The Finch
Offline
Enthusiast
Cincinnati
Last seen: 17 years 7 weeks ago
Cincinnati
Timezone: GMT-5
Joined: 2004-08-01
Posts: 65
Points: 0

Navigate without loading whole page every time?

Or you could always use alistapart's PHP menus

http://www.alistapart.com/articles/keepingcurrent/