Is there a way to include all the meta tag
, link rel
and script src
includes in one file, and then require that file?
The reason I ask is because I have like 10-15 lines that i am copying into every file and figured there might be another way.
I put everything in one file and tried the Jquery load function, but to no avail.
Thanks
Maybe you can use php echo to every page. for example: <
?php include 'path/to/your/file'; ?>
With only js and html you have 2 ways:
1) create a js script and load it every page (not so much different from now but copy much less rows)
2) just do 1 page and refresh part of the content (or whole body) with an Ajax call.
What are you looking for it's a server side pre-processing that "merge" parts so it's very simple to do with php (include), java/jsp, .net and so on.
If you are wanting to use jquery you can use the get function and then append your files values to the tag.
It would look something like the following:
Create a head.html file like this:
Now include header.html in your HTML pages like this: