HTML, DIVs, CSS and Content
Author
Discussion

TheExcession

Original Poster:

11,669 posts

280 months

Sunday 2nd October 2005
quotequote all
ok,

After taking the advice of some people here I'm reworking my site to purely use CSS etc.

So having ditched the frames, I have done a layout which has a top-bar div accross the top of the page.

Down the left hand side I have a Div with my menu in it, then the rest of the screen is taken up by a DIV where I want the contents to go.

How (in Javascript or what ever) can I processa click in the menu and get the browser to fetch some page data and load it into the 'Content' DIV.

Am I completely barking up the wrong tree here - does the browser need to refresh the entire page info - a bit like a target = _Top, when what I'd like to do is a target = content-div thus preventing a full page reload and then having to track the state of the expanding men.

some pointers would be cool.

thanks guys.

wtd

818 posts

263 months

Sunday 2nd October 2005
quotequote all
www.w3schools.com/ mate

>> Edited by wtd on Sunday 2nd October 13:54

_dobbo_

14,619 posts

278 months

Sunday 2nd October 2005
quotequote all
You could do it with an IFrame but that's not ideal, since it sort of defeats the point of dropping frames in the first place...

Aside from that, I wouldn't know other than a whole page reload.

The beauty of using CSS is that your HTML code is so light page reloads should be lightning fast anyway.

PetrolTed

34,468 posts

333 months

Sunday 2nd October 2005
quotequote all
You're barking up the wrong tree.

Load a new page but share the menu code via an import.

GreenV8S

31,024 posts

314 months

Sunday 2nd October 2005
quotequote all
PetrolTed said:
share the menu code via an import.

Do you just mean including a common menu implementation (HTML and/or script) in both pages, or is this some devious mechanism to have the two pages share state information?

TheExcession

Original Poster:

11,669 posts

280 months

Sunday 2nd October 2005
quotequote all
PetrolTed said:
You're barking up the wrong tree.

Load a new page but share the menu code via an import.


Would that import be handled in asp or php etc...

At the moment eeverything is very static, I just have a bunch of pages, what I don't want to do is end up having a stock template that is used for all my pages and then find later I want to change something and have to go back and edit every page. (If you get my drif/concern).

I suppose I could go the whole hog and do it really properly by having all my page content in stub files, then use php to import the relevent page accosing to a menu clikc passed back to the server.

This was one of the reasons I initally went with Framse - it does appear to me that a frames based approach keeps the page data files simple to maintain.

cheers

robbieduncan

1,993 posts

266 months

Sunday 2nd October 2005
quotequote all
GreenV8S said:

PetrolTed said:
share the menu code via an import.


Do you just mean including a common menu implementation (HTML and/or script) in both pages, or is this some devious mechanism to have the two pages share state information?

A lot of servers support Server Side Includes. Google should give you an example.

You can do what you are talking about via AJAX if you really want to, but this is not a great idea as it will break the back button...

_dobbo_

14,619 posts

278 months

Sunday 2nd October 2005
quotequote all
Server side includes makes life much easier - Most often when I write a site, I have a head and foot file which control layout and menus, and then simply include these on each page.

This way a total site redisign can be done in two files

PetrolTed

34,468 posts

333 months

Sunday 2nd October 2005
quotequote all
_dobbo_ said:
Server side includes makes life much easier - Most often when I write a site, I have a head and foot file which control layout and menus, and then simply include these on each page.

This way a total site redisign can be done in two files


TheExcession

Original Poster:

11,669 posts

280 months

Sunday 2nd October 2005
quotequote all
"Server side includes" - that was the phrase I was looking for.

cheers guy's - I'll get busy with that and see how I get on.

TeamD

5,060 posts

262 months

Tuesday 4th October 2005
quotequote all
Pain in the ass innit? It's a shame that a DIV can't be a document and therefore have a .location. It would make life so much easier.

PetrolTed

34,468 posts

333 months

Tuesday 4th October 2005
quotequote all
You can do it with htmlContent - that's how I did the Google maps in the classifieds. It's a sledgehammer to crack a nut though.

judas

6,240 posts

289 months

Tuesday 4th October 2005
quotequote all
Couple of good book recommendations for ya!

HTML Utopia: Designing without tables using CSS by Dan Shafer

and

The Zen of CSS Design by Dave Shea and Molly D Holzschlag

>> Edited by judas on Tuesday 4th October 14:50

TeamD

5,060 posts

262 months

Tuesday 4th October 2005
quotequote all
PetrolTed said:
You can do it with htmlContent - that's how I did the Google maps in the classifieds. It's a sledgehammer to crack a nut though.


Isn't that a server side operator hence it precludes being able to modify the location on the fly at the client end? I think I see what TheEx is getting at, when he uses frames, because one is used for the display of dynamic information, the one that he doesn't refresh/reload maintains context for it's menus etc. I've yet to see a coherent reason as to why frames are so bad.

judas

6,240 posts

289 months

Tuesday 4th October 2005
quotequote all
TeamD said:
I've yet to see a coherent reason as to why frames are so bad.

Two words: search engines. As strange as this seems, they still can't cope well with frames-based sites. If search engine placement is not an issue then use them! Still, doing it all server-side is a much better solution in the long run.

robbieduncan

1,993 posts

266 months

Tuesday 4th October 2005
quotequote all
judas said:

TeamD said:
I've yet to see a coherent reason as to why frames are so bad.


Two words: search engines. As strange as this seems, they still can't cope well with frames-based sites. If search engine placement is not an issue then use them! Still, doing it all server-side is a much better solution in the long run.


Bookmarks! If you have a framed site and someone navigates through lots of page links to get to a page they like and bookmarks the page the bookmark the frameset which when they return to the bookmark shows the first page, not the result of all their navigating.

TeamD

5,060 posts

262 months

Tuesday 4th October 2005
quotequote all
judas said:

Two words: search engines. As strange as this seems, they still can't cope well with frames-based sites. If search engine placement is not an issue then use them!


I've never really subscribed to the modifying my code because someone else can't be bothered to fix theirs approach. If it's an issue and I were responsible for the development of the webcrawler code etc then I'd be fixing it at source rather than expecting the world to change because I couldn't be arsed.

judas said:

Still, doing it all server-side is a much better solution in the long run.


Yeah but, no but...There are just some things that you can't do server side, for example, if you're just using IE as a rendering engine, the only bits of the display that you want to refresh on a regular basis are those that are likely to change.

judas

6,240 posts

289 months

Tuesday 4th October 2005
quotequote all
TeamD said:
I've never really subscribed to the modifying my code because someone else can't be bothered to fix theirs approach. If it's an issue and I were responsible for the development of the webcrawler code etc then I'd be fixing it at source rather than expecting the world to change because I couldn't be arsed.

Have to agree with you here - to a point. But try explaining to clients why they're on page 3485323 of a Google search because you used frames to layout their site - always good for a laugh

TeamD

5,060 posts

262 months

Tuesday 4th October 2005
quotequote all
judas said:

Have to agree with you here - to a point. But try explaining to clients why they're on page 3485323 of a Google search because you used frames to layout their site - always good for a laugh


Luckily I'm not it that game. Most of my customers don't care where Google ranks the info I generate, the important thing is that it exists and is correct.