Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML & Javascript - Including a javascript on all the websites in a domain

Can you add the javascript in the desired *.html files without including in each of the *.html files? Like:

<html>
<head>
......<!-- no script-->
</head>
<body>
......<!-- also no script tags-->
</body>
</html>

So can I use a method that will automatically include my desired javascript file in my any future desired *.html files without manually adding <script> tags in my html files? Just like htaccess that will redirect all mis-leading urls in a domain to a 404 page.

Please tell me if I need to add any information.

*edit - I don't want to use iframe

like image 549
Daniel Cheung Avatar asked Nov 04 '22 05:11

Daniel Cheung


1 Answers

Well the concept you're talking about is basically php templating. You can make a single header and footer, and then all you have to change is the body. The header and footer gets included with the page server side.

Besides that there is probably some kind of automated program that can do it auto-manually.

like image 146
Kolby Avatar answered Nov 08 '22 09:11

Kolby