Get ready to use zjrJS. This article explains the what, where, how, and why.
Used zjrJS Version:
Stable Minified version 20141202t2322 of zjrJS.
Who uses zjrJS?
Javascript developers do. Front-end developers do. If you are a designer, an IT pro, or a marketeer: hire a developer.
Where to use zjrJS
Since zjrJS is a javascript library for web pages, the obvious place to use it is inside a web page. How do you get it there?
Download a copy
No, zjrJS is not hosted on the Google CDN yet. Download your own copy. Linking your site to my copy of zjrJS will slow your site down.
For the library to be available to your web pages, it needs to be where they can reach it. Thus, after downloading zjrJS, copy it to your site root. I expect you to know how to do that. If not, contact your hosting provider. (You did set up a hosting contract, right? Even if only a free one?)
Decide which web page
I expect your site sports more than 1 web page. Add zjrJS only to those web pages where you plan on using it.
Add this code to the page's head section
I will assume your web page is written using HTML. If you use anything else, chances are you know how to adjust the sample below. If not, go and get your school payments refunded.
Mind you, that this bit, "20101015T1418", is the actual version information (the year 2010, month 10, day 15, time: 14:18hrs). So if you download a different version, also update the src attribute in the script element. Keep them in sync.
More complete sample code
Some techy details
Some notation remarks
We tried to stay as consistent in our notation as possible, using camel casing for methods and word casing for objects. The only exception is the zjrJS object itself, which conforms to neither format. As such, you will see objects like zjrJS.Debug, zjrJS.Doc, zjrJS.MSIE, zjrJS.Storage, and methods like zjrJS.Doc.aE() and zjrJS.Storage.set(). Sometimes, our notation varies from consistency, as in the method zjrJS.Doc.eid(). Such choices usually stem from readability requirements, or just the whim of the moment.
Javascript developers do. Front-end developers do. If you are a designer, an IT pro, or a marketeer: hire a developer.
Where to use zjrJS
Since zjrJS is a javascript library for web pages, the obvious place to use it is inside a web page. How do you get it there?
Download a copy
No, zjrJS is not hosted on the Google CDN yet. Download your own copy. Linking your site to my copy of zjrJS will slow your site down.
For the library to be available to your web pages, it needs to be where they can reach it. Thus, after downloading zjrJS, copy it to your site root. I expect you to know how to do that. If not, contact your hosting provider. (You did set up a hosting contract, right? Even if only a free one?)
Decide which web page
I expect your site sports more than 1 web page. Add zjrJS only to those web pages where you plan on using it.
Add this code to the page's head section
I will assume your web page is written using HTML. If you use anything else, chances are you know how to adjust the sample below. If not, go and get your school payments refunded.
<script type="text/javascript" src="zjrJS.20101015T1418.js" id="zjrJS"></script>
Mind you, that this bit, "20101015T1418", is the actual version information (the year 2010, month 10, day 15, time: 14:18hrs). So if you download a different version, also update the src attribute in the script element. Keep them in sync.
More complete sample code
<!DOCTYPE html>
<html>
<head>
<title>zjrJS inclusion sample</title>
<script type="text/javascript" src="zjrJS.version.js" id="zjrJS"></script>
</head>
<body><h1>Hello, zjrJS!</h1>
<p>Even though this sample page includes zjrJS, it doesn't actually use it.</p>
</body>
</html>
Some techy details
- Why in the head section? Because the browser needs to "do" zjrJS as soon as possible, so you can start using it before the document is done loading.
- Why no defer attribute? Because that would load zjrJS after the document has been loaded, even waiting for third party images and scripts (ads, statistics, social sharing), making you look bad.
- Can this script element go before or after others? Most certainly. zjrJS was developed to play nicely alongside all kinds of other scripts.
- Does using zjrJS restrict my javascripting in any way? Yes, we strongly suggest avoiding the name "zjrJS" for your own variables.
Some notation remarks
We tried to stay as consistent in our notation as possible, using camel casing for methods and word casing for objects. The only exception is the zjrJS object itself, which conforms to neither format. As such, you will see objects like zjrJS.Debug, zjrJS.Doc, zjrJS.MSIE, zjrJS.Storage, and methods like zjrJS.Doc.aE() and zjrJS.Storage.set(). Sometimes, our notation varies from consistency, as in the method zjrJS.Doc.eid(). Such choices usually stem from readability requirements, or just the whim of the moment.