View Full Version : dHTML in separate file?
ryanod
06-23-2006, 05:12 PM
I am wondering how I can put a menu in a separate file and have it dynamically displayed in an HTML page.
This would be very similar to using frames (have the same menu on 50 different pages, but use 1 file for the menu for ease of editing), but without using frames.
Does anyone know how to do this. I know I can use PHP and include files, but I am wondering how to use DHTML to do it.
Any insight would be greatly appreciated. Thanks.
ryanod
It's not really possible. You can include scripts with <script src="..." type="text/javascript"></script>, and CSS with <link rel="stylesheet" type="text/css" href="...">, but there's no acceptable way to include HTML client-side. You can do it by having document.write() calls in an external script, which you can include, but it's not a good idea.
ryanod
06-23-2006, 07:19 PM
So, does that mean that if you have a corporate web page that has, say, 100 separate pages and each one has a CSS based drop down menu you have to code in the HTML based content for the menu on every page??
What happens if you want to change the menu?? Do you have to change every single page?? Is there a batch method for accomplishing this??
Maybe the answer is obvious and that answer is to use PHP or ASP to design this kind of site??
Thanks for the response.
ryanod
Maybe the answer is obvious and that answer is to use PHP or ASP to design this kind of site??Right :) Server-side languages are the only acceptable way of doing this.
ryanod
06-24-2006, 07:57 AM
Thanks for the confirmation.
ryanod
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.