Skip To Main Content | Home | Sitemap | Contact
Latest Visitors: United States's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagUnited States's flagItaly's flagSweden's flagUnited States's flagSweden's flagUnited States's flagUnited States's flagLatvia's flagParaguay's flagHungary's flagFrance's flagKenya's flagUnited States's flagUnited States's flagUnited States's flagNetherlands's flagChina's flagChina's flagUnited States's flagUnited States's flag
 

How can you use JavaScript to include another file on your page?

Use the remote scripting object.  See this article.







<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>JavaScript Include Example</title>
<script type="text/javascript" src="/include/include_v2.js"></script>
<style type="text/css">
<!--
img {
    border:0;
}
-->
</style>
</head>

<body>
<noscript>This page requires JavaScript to be supported or enabled for complete functionality.</noscript>
<div class="btnCenter"><input type="button" name="btn1" value="Click To Change" onclick="include('/include/emails.txt','theExample','images/loading_icon.gif');"><br></div>
<div id="theExample"><iframe name="altFrame" src="latin.htm" scrolling="no" frameborder="0">Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></div>
<div class="btnCenter"><input type="button" name="btn2" value="Click To Change" onclick="include('/include/movies.txt','theExample1','images/loading_icon.gif');"><br></div>
<div id="theExample1"><iframe name="altFrame" src="latin.htm" scrolling="no" frameborder="0">Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></div>
<script type="text/javascript">
//<![CDATA[
include('latin.htm','theExample','images/loading_icon.gif');
include('lincoln.htm','theExample1','images/loading_icon.gif');
//]]>
</script>
</body>

</html>