Basic HTML5 tutorial for Beginners

Introduction to HTML5. This simple tutorial is for Newbies/Beginners, who are just starting off with HTML5.
Continue Reading

Cut & Paste Random motivational quotes

Description: This script displays a random motivational quote on your site, out of 30. The quotes are contained inside a separate JavaScript file, making any updates to the quotes instantly reflected on all pages that contains the quote script. Lift the spirits of your visitors with this script...they deserve it!
Continue Reading

Understanding the two methods of the Math object required to create a random engine

While it is safe for us to ditch the philosopher, it's not exactly wise to do the same with the mathematician. Mathematics play a pivital role in JavaScript when creating a random engine, in the form of the Math object.
Continue Reading

Randomizing the display order of content using JavaScript

HTML demands that content be displayed either sequentially, or at least in some static order inside the webpage. Using JavaScript, we can jiggle things up, and display pieces of content that randomly interchange order. The result is a group of content that randomly changes display position each time the page is loaded, allowing each of them to receive equal attention from viewers.
Continue Reading

Determining JavaScript cookie support in client's browser

If your script relies on JavaScript cookies to persist and store information for retrieval later, it's good practice to always make sure that the user's browser supports cookies first. This includes whether the browser has cookies enabled (an option in most browsers). Depending on your situation you can then either remind the user to enable cookies, or create code to handle these cases silently.
Continue Reading

Restricting access of JavaScript libraries to designated domains

JavaScript libraries allow us to separate script from page, so multiple pages can all utilize the same script simply by linking to it:
Continue Reading

Dynamically loading an external JavaScript or CSS file

The conventional way to loading external JavaScript (ie: .js) and CSS (ie: .css) files on a page is to stick a reference to them in the HEAD section of your page, for example:
Continue Reading