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.

3

2 Answers 2

1

Search for Underscore Templates and how to use them.

Sign up to request clarification or add additional context in comments.

Comments

1

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

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.