Hello,
I used the script
<!--#include virtual="dontate.html" -->
to include a .html file into another .html file, but for some reason does not show up.
Any reason as to why?
I will be using WAMP and LAMP.
Thanks Jean
Hello,
I used the script
<!--#include virtual="dontate.html" -->
to include a .html file into another .html file, but for some reason does not show up.
Any reason as to why?
I will be using WAMP and LAMP.
Thanks Jean
This is using server-side includes. You need to set it up on your server. Despite the misleading "comment" syntax, it really has nothing to do with HTML.
if there's php on the server you can just include the html file like so
<?php include "donate.html"; ?>
A lamp stack has php so you should be set.
However, the server may not be set up to run the file through php's interpreter. You can either set it to parse whatever the extension of the file is (being the file that is doing the including) or change it to something that is already set to be parsed (home.html -> home.php)
Perhaps the problem is the use of virtual
The
file
parameter defines the included file as relative to the document path; thevirtual
parameter defines the included file as relative to the document root.
<object data="file.html" width=400 height=200"></object>
If memory serves... I recall some border issues in IE but that should be sufficient for a primitive integration.
Guys..here is the answer
// jsfile.js
var variable=""+
"";
document.write(variable);
*include .js file in html*
thats it
As your using wamp/lamp I found something that will work:
creating a .htaccess file and put the following in it
Options FollowSymLinks Includes ExecCGI
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Then change your html file extensions to .shtml (including the file that is to include a file)
So
<!--#include virtual="dontate.html" -->
Would become
<!--#include virtual="dontate.shtml" -->
This should work
NOTE:
The the file is in the same directory as the file that is including it use:
<!--#include file="dontate.shtml" -->
If it is in a different directory use:
<!--#include virtual="folder/to/file/dontate.shtml" -->
As per the HTML spec, the only way to do this without server side scripting or server side includes is via iframes.
* note the bolded 'only'.