We help IT Professionals succeed at work.

Loading navigation on all web pages from 1 source

Letsgetcoding
on
Medium Priority
206 Views
Last Modified: 2012-05-11
Hey,

So as stated in the title I would like to load a part such as the HTML behind the navigation bar on all my pages, so when I change something in the navigation menu it is applied to all pages. I  use notepad for doing the scripting.

Id like to be able to do this for things like the footer etc also

How do I do this?

Thanks!
Comment
Watch Question

Gk

Commented:
I dind et it clearly.

Is it something like include php code in all the pages? use ' include'.
If you want it at browser side, use java scripting to update a names Div tag in all pages.
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Is it easy writing HTML into a PHP file to call it?

Another thing I want to clear up, does a page have to be PHP to call PHP functions from another file?
Jagadishwor DulalSenior Web Developer
CERTIFIED EXPERT

Commented:
Yes you can not call php code in a html page you must change file extension to php and you can call functions to another page but before calling function you must include function page in the current page.

Author

Commented:
Ok thanks.

How do I do it browser side using JS?

Commented:
<!--#include virtual="/footer.html" -->
Gk

Commented:
all the page should access a variable from your navigation page. same way if you update it, refresh the loaded page also.

you can access the other page by parent.framename.varABC ...

Author

Commented:
Fixed this issue by having a php site and using Include()

Thanks all.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.