0

I have several html pages and they all use a div that is exactly the same.

I want to have this same div in a separate file so that every time I have to make changes I won't have to copy the new version over and over again.

I don't know where to start and the proper terminology for this, but I'm confined to html and javascript.

Zephram
  • 499
  • 3
  • 7
  • 16

2 Answers2

1

Search for Underscore Templates and how to use them.

Igl3
  • 4,900
  • 5
  • 35
  • 69
1

If you use jQuery you can use ajax.load as so:

$( "#yourDivId" ).load( "yourfile.html" );

http://api.jquery.com/load/

spacebean
  • 1,554
  • 1
  • 10
  • 13