Method 2: Use Server-Side Include Files

Server-side includes (SSI) are enabled by default on Internet Information Server (IIS) and Apache web servers. To use them, you need to set up the include file and include statements.

You can either configure the server to run SSI on all files with the extensions you use for your web pages (.htm, .html), or you may need to change your page extensions (to .stm, .shtm, and .shtml, for example).

  1. Place the include file that contains the JavaScript tag in a location accessible to every page of your site.
  2. Place an include statement on all of your website pages. Be sure to use the correct file extensions. For example, if your include file is named code_include.inc and located in the mymobilesite directory, you place the following include statement on your web pages:
    <!--#include virtual="/mymobilesite/code_include.inc"-->