Blog
Javascript Code Blog Image

Better Living through JavaScript: Three Ways to Use Client-Side Scripting

JavaScript is a well known, established contributor to the way we experience the web. JavaScript has formal standards. It has advanced libraries to ease the developer's job and better match special needs. Perhaps best of all, JS can, and usually does, run entirely within the web browser.

Traditional JavaScript: distributed by the server, compiled by the browser

Usually, we use JavaScript to enhance HTML interpreted by the web browser, either integrated into the HTML code or linked to it through .js files, giving the skilled developer complete and dynamic control over the document object in the browser. When it comes to to user interfaces or the ability to make changes on the fly without having to send data back to the server (or even worse— waiting for the response that may eat up valuable seconds), JavaScript is king. Because it runs locally, JavaScript can provide the snappy, responsive results that web users have come to expect.

Somewhat less well-known are the ways JavaScript can be employed by the user to change their personal web experience. These changes range from small page changes to complex features that rival standalone applications in power.

Browser extensions

Firefox and Chrome both allow users to install extensions written in JavaScript. There are lots of other rules a developer working with these extensions will need to adhere to, but the core programming language is JavaScript. Once installed, these extensions can have unlimited control over document objects handled by the browser.

Large antivirus software companies use extensions as a major part of their protection strategy, employing the control made possible by JavaScript to limit malicious code as well as to generate in-browser interfaces. Smaller developers have made ad-blocking software, which remove known ads from the document object before they're presented to the user. Others add widgets to web pages to offer overlays or handy controls for special tasks, to enhance games, alert users when they receive new messages, and nearly anything you can imagine if it involves the web.

The publicly available extensions are often produced by professional programmers, but they don't require professional tools to develop. Even a hobbyist can get in on the act— it's easy to develop an extension that only you will ever use, or which you share just with co-workers. For instance, a web application custom-engineered for your office, but which may need a few interface tweaks, can be improved with relatively little work, even if you don't have any hope of accessing the server-side code behind it.

Bookmarklets

JavaScript bookmarklets are a less demanding alternative to extensions. They require no special tools beyond the browser, not even a text editor. I use a short bookmarklet I wrote for myself to highlight tasks in our in-house ticketing system according to my needs. I use a much longer bookmarklet written by someone else to superimpose a layout grid over web pages I'm working on, which adds its own configuration interface in a slideaway box.

The chief limitation is that bookmarklets need to be activated by the user on each page. They tend to follow fewer rules than extensions, and to be used mostly for simpler tasks, but they're not short on power.

If you’d like to learn more about what web technologies could help your website, contact us today.

Image Credit: http://tinyurl.com/jjyvdh9
Are You Ready to Start Your Project?