arpit_vavadia
12-29-2008, 10:42 PM
I have two HTML file Main.html and Menu.html . Now I wish to include Menu.html into Main.html how can I do that .
|
Click to See Complete Forum and Search --> : Include one HTMLfile into another HTML file arpit_vavadia 12-29-2008, 10:42 PM I have two HTML file Main.html and Menu.html . Now I wish to include Menu.html into Main.html how can I do that . NogDog 12-29-2008, 11:01 PM It can be done via "server-side includes" if your web host configuration supports it, or via server-side programming such as PHP, Perl, JSP, .NET, etc. depending on what your host supports. donatello 01-02-2009, 09:30 AM I know of a few ways... depending upon what you want to do... 1.) PHP Include (PHP Include (http://pl.php.net/include/)) 2.) iFrame 3.) HTML tooltip 4.) Ajax Tabs (The coolest way by far.) PHP include is often used for dynamic content generation, and the HTML included can be snippets. iFrame is bad for SEO, but if you need to use it for some reason, it would look like this: Web Cam Search (http://www.web-cam-search.com) HTML tooltip is a way to dynamically display small bits of HTML and images on mouseover... it's a bit gimmicky... probably not what you want... Ajax Tabs is my favorite way to do this, as the page then looks very first class. The main page of Yahoo! does this! There is an easy script for this over at Dynamic Drive, it's the first result on this search: Ajax Tabs (http://www.javascriptsearch.org/results.html?cx=016703912148653225111%3A2snawkdvrjq&cof=FORID%3A9&q=ajax+tabs#914) Charles 01-02-2009, 10:04 AM AJAX doesn't work for a good number of your users so you would have to have a redundant backup. XHTML has a method of including external files. Support is spotty but growing. You could serve the client XML, and XHTML is XML, with an XSLT Stylesheet that includes the static content. These options are all a bit gimmicky and iffy, best to just use some sort of server side include. What's available to you will depend upon your server and its configuration. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |