If you've been on the Internet for a while, you've probably seen numerous examples of JavaScript use. JavaScript is a powerful scripting language used to create special effects on your website, but did you know it can also be used as a very powerful web design tool?
Have you ever joined a new affiliate program or created a new publication that you wanted to add to your existing navigational set up, but dreaded having to manually add the links to every page on your site?
You can use JavaScript to enable you to dynamically update every page on your website with just one file. This technique is the same technology used by numerous syndication services on the Internet. It enables them to deliver dynamically updated content to every website in their program.
Before we begin, if you'd like to see an example of a navigational system that is dynamically displayed, visit Web-source.net. This website has over one thousand pages and each and every one of them displays its navigational system using JavaScript. If I want to add an additional link, I simply update one file and every page on the site is automatically updated.
The first step in setting up your JavaScript feed is to create the file that will contain your content. To do this, open a text editor such as NotePad and simply copy and paste your existing navigational setup into a new page. There is no need to begin the page with <HTML><HEAD>, etc. as you are only creating the feed for one section of your existing web page which already has those tags.
Once you've created your new page containing your navigational HTML, you'll now need to add some additional JavaScript coding to each line of your HTML. The first line of your new file will look like this:
<!--
The next line will begin with "document.writeIn('" and end with"');" (without the quotes). Your first line of HTML will be placed between the beginning and ending coding. For every line of your original coding, you'll need to add the above-mentioned codes before and after. Note: Make sure you don't add any extra spaces, including at the end of each line, as JavaScript is very sensitive. Your new file will end with //--> on the last line.
Here's how your code might look:
<!--document.writeln('<TABLE BORDER="0" ALIGN="Center">');document.writeln('<TR>');document.writeln('<TD>');document.writeln('Your table content');document.writeln('</TD>');document.writeln('</TR>');document.writeln('</TABLE>');//-->Each backslash () should be preceded with another backslash.Example:
Each apostrophe (') should be preceded with a backslash.
Example: '
You can include most HTML and JavaScript coding however, you cannot include JavaScript that must access another file to run.
After you've created your content and added the specialJavaScript coding, you'll need to save your new file. Try to select aname that reflects your file such as navigate.js and make sure yourfilename is no longer than eight letters. Next, you'll need to create anew directory on your server where you store your HTML files. Name thisdirectory "content" (without the quotes) and upload your new .js filein ASCII.
Here's where the magic occurs... Place the following code inyour HTML pages where you would like your navigate.js content to bedisplayed. Make sure you change the URL and direct it to your new .jsfile. The following code must be displayed exactly as it appears. Makesure there are no spaces after the first line of code.
<SCRIPT language="JavaScript" src="http://www.yourdomain.com/content/yourfile.js"></SCRIPT>If you've followed the above steps correctly, your navigational system should now be displaying on your web page. If you are receiving a script error message, most of the time, it's due to an extra space at the end of a line or an extra or missing character. Make sure you go over your code very carefully. Once you've created your content feed and it is displaying your content, updating your file will be simple.

If you'd rather not have to code the JavaScript yourself, I use a great script called, Master Syndicator which will code your content for you. I highly recommend it. Web-source.net
Using JavaScript to display your navigational set up can not only enable you to instantly update the content on every page of your website, but can also save you hours of valuable time.
Related Articles
- The Basics- JavaScript TutorialTo get started with JavaScript, you will want to be able to see the tag that will set a script apart from the HTML. The tags used to begin and end a script are the tags. The opening tag should appear like this
- 4 Powerful Features of Javascript Programming LanguageIn the community of web developers and surfers, Javascript is highly popular as client side scripting language for web browsers. Lets take a look at some of the features of this language.
- The Latest Google Page Rank UpdateI am not sure how many people have noticed or even care, but there seems to have been another page rank update from Google. This update is very strange however and things are happening that are a lot different from anything I have ever seen before.
- JavaScript PromptsWell, lets say you wanted to get somebodys name before they saw the page, and then write their name on your page right before their very eyes... Well, you can do this using a javascript prompt. Heres the command:
- Javascripts For Your WebsiteHere is a list of short but invaluable Java scripts you can insert into your own site code to implement a number of small but extremely useful features.
- Introduction to Javascript for NewbiesJavascript is a client-side programming language whose processing engine is embedded in web browsers like Internet Explorer, Netscape, Firefox, etc. This enables the processing engine to read and interpret web pages that contain the javascript code when browsing
- Form ValidationLearn the different ways of validating your form with Javascript.
- Customizing the Status Bar MessagePlace this script in the section of your web page code to add a scrolling marquee to your status bar.
- Statusbar MessageThis is a quick, and quite simple tutorial. Now its not html, it uses Javascript. What it does is lets you customize what it says in the status bar usually at the bottom left of your browser. Right now in your browser it should say Infinite Designs.org ..... Heres how to make it do that...
- Stop Right Mouse ClicksStop people from getting at your source by right clicking on your web page. Sounds good, but doesnt protect you totally, you can never fully protect your work, but it will make it harder.
