Include html in multiple documents

Associate
Joined
6 Jul 2003
Posts
49
i have the following issue.

i am trying to include an html file(my dropdown menu) into a div in an html file.

cannot use iframe cause the dropdown wont work.

i have tried this
<?php
include("menu.html");
?>
but its not working either.

then i used this script

<script type="text/javascript">
$(document).ready(function() {
$("#menu").load("menu.html");
});
</script>

and it works in firefox and explorer but not in chrome!!!

any ideas???

thnx in advance...
 
To get the PHP include 'trick' to work I think you need to include the HTML into a PHP file. You can't, I believe, use the PHP include method in an HTML file. So rename the HTML file to have a .php file ending and that should then work.
 
If you do a view source on your html page in a browser and see the contents enclosed within the PHP tags then Marc is correct your web server isn't processing the html page for php.

Renaming the page from .html to .php will be the fastest way to make the php code work.
 
Back
Top Bottom