You can also do it using
Server Side Includes . I have never seen it done with
JS but it probably could. Keep in mind that
JS is a client side language which can be turned off by the user. This means that your page wouldn't work. You can do it with
ASP also.