I use script type="text/template"
for my project and I use a lot of templates, I want write my template in foreign file and include it to my html
If its possible , what type of file must i use and how must write it ?
I use script type="text/template"
for my project and I use a lot of templates, I want write my template in foreign file and include it to my html
If its possible , what type of file must i use and how must write it ?
Copyright © 2021 Jogjafile Inc.
In a pure JavaScript/HTML environment, you can't easily.
Your choices are:
Use some kind of JavaScript template library
I'm only familiar with Durandal that uses the Knockout engine.
AngularJS seems to be another popular choice.
Most of these packages include far more than just templates and may be overkill.
Use a server-side template package
PHP is a popular server-side tool.
Some HTTP Servers support Server Side Includes, but these are so limited I couldn't actually recommend them.