|
• Tutorials: JavaScript: Include Ever wanted to have the effect of only updating one link on one file and your whole site updates the link. Now you can without having PHP or SSI to include a file, meaning you can do this on a Geocities site with ease. Start off by placing this on your html page(the file you want the links to appear on): <script src="left_navigation.js"> </script> Now you need to make a file on notepad which will contain the links that will be included on your html page. Open notepad, add this to it(you can add additional links and html to it): //Type out text document.write("- <a href='link01.html'>Link 01</a><br>"); document.write("- <a href='link02.html'>Link 02</a><br>"); //End Type out once you're done adding your links save the file as: left_navigation.js Upload both the files in the same directory(folder) and it should work perfectly. Note: left_navigation.js can be renamed to whatever you want links.js as long as it keeps the .js extension and that you also change the name in the <script scr="file_name.js"> tag. You can also have multiple .js files for right and left navigation includes. Do not hit enter when typing stuff inside the output ("_here_"); or it will give you a JS error. |