crestind
05-27-2008, 02:22 PM
I notice most sites use the .html extension, so am I right to assume that these sites are using Javascript templates? And if so, is this (below) an appropriate and effective way to do so? I would have numerous js links in the page that would be called for.
<html>
<body>
<script src="leftdiv.js"></script>
<script src="rightdiv.js"></script>
<script src="footerdiv.js"></script>
</body>
</html>
Contents of the rightdiv.js file
{
document.write("<div><h1>This is a header</h1><p>This is a paragraph</p><marquee>test</marquee></div>");
}
etc.
I am currently using PHP with the same method above, but that does not seem to be a popular alternative since I see few .php pages. Plus, I can't seem to link outside of the same directory.
<html>
<body>
<script src="leftdiv.js"></script>
<script src="rightdiv.js"></script>
<script src="footerdiv.js"></script>
</body>
</html>
Contents of the rightdiv.js file
{
document.write("<div><h1>This is a header</h1><p>This is a paragraph</p><marquee>test</marquee></div>");
}
etc.
I am currently using PHP with the same method above, but that does not seem to be a popular alternative since I see few .php pages. Plus, I can't seem to link outside of the same directory.