Web Hosting Offers
See the new scripts recently added to Dynamic Drive. Click here.
Original, practical CSS codes and examples such as CSS menus for your site.
    Search code samples  
 
  Keyword
 
 
 
   
 
 
  Code Samples
 
ASP
CSS
Dhtml
Html
Javascript
PHP
 
   
     LOGIN HERE  
 
Username
Password
Forgot Password
Verify Signup
 
 
 

Javascript >> General

how to add a client-side include to a page

Visitor Ratings (1) :

Description
step one: create the include file
the include file is simply a .js file with a document.write() call that adds the desired html to the target page(s).

step three: link to your include file
on every page that you want your included html to appear, add the following code exactly where you want the html to show up:

<SCRIPT LANGUAGE="JavaScript" type="text/javascript" src="myInclude.js"></SCRIPT>

change the file name ("myInclude.js") to match the name of the .js file you created.
Code
Select All
 Rate this Resource