HTML designing with no frames and opening no windows

Hi,

I am a new member, I will go in and introduce myself later today in the introductions thread as suggested in the welcome email. Right now I am on a tight deadline and hoping you can help me in the meantime. I need some advice and guidance. I have been a flash designer for years and now I am learning css and html and php. I have a site I am working on, I am about 40% along and I do not want to use frames or open any other windows. I am finding that when I change one thing, I have to change it on every page. For example, the client wants a small blurb about shipping on every page, is there a way I can do this and only have to change it once? Quite a few things like the navigation appear on every page.

Thank you.

From the list of what you are using the thing you need to do to resolve the content you want the same on all pages is to use a PHP include to contain each common part of the page.

That’s basically a separate file with the part of the page in it and an include statement inside every page where you want that code to go. Change that one file and that part of all your pages change all at once.

Thank you! I looked it up and tried it and it works great. I know I didn’t list javascript, but can I do it with that as well? Is it as simple? Thanks!

Not everyone has JavaScript enabled so it should only be used to enhance web pages, never for anything that the page depends on.

Congratulations on the move to HTML and CSS. You may feel at times like going back to flash because of browser rendering bugs but hang in there - it’s for the best :slight_smile:

You’ve found a great resource to help you find answers when you need them.

HTML -> content
CSS -> presentation
Javascript -> behaviour

It’s best to keep as clear a separation of these 3 as possible. Each can and and should be independent of each other.

I really appreciate it. I ended up going to bed early, I am catching a cold and trying to keep it at bay.

felgall - I will remember that and always keep it in mind. thank you.
markbrown4 - you really think it’s for the best?

Thanks again.

Without a shadow of a doubt - flash should never be used to create complete sites. Flash has it’s uses but making website’s is not one of them.

I completely agree. When you mentioned Javascript for behavior, what did you mean? Since felgall said to use it sparingly since some people have it turned off.

Under the banner of behavior are things like Events(keyboard, mouse etc.) communication with the server, and animation.
Felgall is saying that the pages shouldn’t rely on javascript to work - they should be perfectly usable without it - just better of more rich experience with it enabled.

In a sense, yes. One external Javascript file can serve many pages at once, if you link to it in the head section like so:


<script type="text/javascript" src="myscript.js"> </script>

The key is being unobtrusive, having the scripts layered on the top of an existing website so that when the functionality is available, it works using that but if scripting is unavailable it’ll just carry on with the minimum level of support (usually consisting of server-side code which is guaranteed to work for everyone). If you want to know more about unobtrusive scripting with JavaScript I highly recommend Jeremy Keith’s book DOM Scripting. as pretty much any core level of functionality which is available at the client-side (JS) can be done at the server-side, you let the server have the default functionality and then can back it up with the more flourished and polished behaviour which JavaScript can offer. An example would be having a contact form, you would use PHP to validate the form fields were input correctly but could have some JavaScript to check before the script is run (less refreshes). Though on a side note, I don’t think JavaScript’s method of including content from separate files is anywhere near as clean as server-side scripting (especially with accessibility in mind) so I would avoid it for such usage. :slight_smile:

Thank you Mark for saying it the way a flash person would understand. :slight_smile:

Ralph, Thank you, I am familiar with that simple code. The problem would be the code in the myscript.js. lol

Alex, Thank you for that info!

Javascript should be used for enhancing the user experience, by changing the way a page behaves - but it should not be essential.

If you think of it like a car - the HTML provides the basic shell of the car and the engine and the wheels, enough to make a car that can be driven - the CSS gives it a lick of paint and a nicely shaped body - the Javascript makes the electric windows and cruise control work, all the things that make it a nicer car to drive, but aren’t actually essential.

So for example, you might have pop-up menus that are made to work by CSS, but you can then use Javascript to add effects like having them slide into place, holding them for a moment after you move your mouse away - but don’t make the whole menu reliant on Javascript to work at all. The idea is that someone without Javascript running can access all of your website through, as far as possible, the normal channels - but they might miss out on some of the niceness.

Late response, Ever consider using wordpress on his site to basically be a content management system?

Ok guys, I am back with another question. I don’t know if I should start a new thread or not. How hard is it to load another php page, on click, into the div?

http://organichs.com/ohsNew/index.php

the yellow part comes from indexHome.php

if someone clicks on <E3Live® (Original)> from my menu, I want to load that page into the yellow part of the site.

I have done google searches and this seems to be close to what I want, but I no nothing about ajax and would like to keep it as simple as possible. http://www.dynamicdrive.com/forums/showthread.php?t=12822

Just have the page included via a PHP include() and then just google a regular onclick hide/show thing :slight_smile:
This is more of a JS/PHP question though.

Ryan, Thank you so much, but I got it working yesterday with JS and lynda.com. :slight_smile: