Use JavaScript To Dynamically Update Your WebsiteUse JavaScript To Dynamically Update Your Website

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 http://www.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 , 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: on the last line.

Here's how your code might look:

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 special JavaScript coding, you'll need to save your new file. Try to select a name that reflects your file such as navigate.js and make sure your filename is no longer than eight letters.

Next, you'll need to create a new directory on your server where you store your HTML files. Name this directory "content" (without the quotes) and upload your new .js file in ASCII.

Here's where the magic occurs... Place the following code in your HTML pages where you would like your navigate.js content to be displayed. Make sure you change the URL and direct it to your new .js file. The following code must be displayed exactly as it appears. Make sure 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.

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.

by Shelley Lowery
References and Bibliography

Copyright ? Shelley Lowery

About the Author:

Shelley Lowery is the author of the acclaimed web design course, "Web Design Mastery" (www.webdesignmastery.com) and "eBook Starter - Give Your eBooks the look and feel of a REAL book" (www.ebookstarter.com)

Visit www.Web-Source.net to sign up for a complimentary subscription to eTips and receive a copy of Shelley's acclaimed ebook, "Killer Internet Marketing Strategies."

You have permission to publish this article electronically, in print, in your ebook, or on your web site, free of charge, as long as the author bylines are included.

Rated:NR/0 Votes
2 Views
Add To My Article Reading List
Add To My Article Reading List
Print Article
Print
More Article By Shelley Lowery
More Article by Shelley Lowery
Share
More Articles From JavaScript
More Articles From JavaScript
Related Articles and Readings
Apotheosis the Seminal Insight of the Hero for Screenwriting By: Kal Bishop
Every hero has a seminal insight - the apotheosis. Once you know what that insight will be, you can start building your story up to and beyond that point:In Casablanca, Rick's insight is that if you love someone, you sacrifice yourself for their happiness. That sacrifice can include selling your ...
Five Simple Spelling Rules By: AE Wise
1. ?I before E except after C?I was first introduced to this little chant in the first grade and it has served me well ever since. However, its simplicity is deceiving! Remember this is American English and with that comes "the exception to the rule!"The Exception: ?I before E ...
How To Properly Recondition Your Xerox 13R546 Drum Cartridge In Less Than 60 Minutes By: Joseph Mercado
The Xerox 13R546 laser drum cartridges are relatively easy to recondition. Similar in many ways to the 5318 style cartridges, which preceded them.It is a simple matter of disassembly, a thorough cleaning, inspection of the Drum and Cleaning Blade, and repair of the Connector.The Connector is key to resetting the ...
Creative Screenwriting Heros Journey and the Apotheosis By: Kal Bishop
The Hero's Journey is the template upon which the vast majority of successful stories and Hollywood blockbusters are based upon. Understanding this template is a priority for story or screenwriters:The Hero's Journey:? Attempts to tap into unconscious expectations the audience has regarding what a story is and how it should ...
The information provided in this article and/or the comments is the sole responsibility of their respective authors and does not necessarily reflect the opinion of ezinepost.com. ezinepost.com  does not endorse any article and/or comments published by our web users unless otherwise noted. 

Member Panel

login to submit articles and more

StatisticsEZINEPOST.COM

  • » Active Categories: 419
  • » Active Articles:252609
  • » Active Authors:31915
  • » Active Members: 38222
  • » Statistics Updated:
    - Thu May 7th, 2020 12:50AM EST