-
Notifications
You must be signed in to change notification settings - Fork 2
gsjs
Note: In this guide I assume that you have experience working with JavaScript. If you do not read Getting Started Guide (no JavaScript experience).
Hilo.js (pronounces he-lo) is a JavaScript Framework / Library that helps you create interactive web applications with ease. If this sounds confusing, Hilo is something that makes writing JavaScript easy. Whatever you write using Hilo's API is JavaScript. Hilo is also supported by legacy browsers like IE 7,8,9. So, it's backwards compatible.
Yeah, sometimes. But it's completely optional. And it's not so easy to support the maximum number of user agents (browsers).
Hilo supports IE7+, Chrome 1+, Firefox 2+, Opera 10+ and Safari 5+.
Let's consider a situation where you need to do something on click of button or something. If you want to do it with vanilla JavaScript with backwards compatibility (old/legacy browser support), you would write something like this:
Markup:
<button id="clickMe">Click me</button>
<span id="content">Hello World</span>
JavaScript:
(function () {
var cl = document.getElementById("#clickMe")
, el = document.getElementById("#content");
function changeContent = function () {
el.innerHTML = 'Hilo Wald';
}
if (document.addEventListener) {
cl.addEventListener("click", changeContent, false);
} else if (document.attachEvent) {
el.attachEvent("onclick", changeContent);
} else {
el.onclick = changeContent;
}
}());
That's just little code, right? And if you're going to do it with Hilo, there's just a little code and that's not so confusing.
Hilo Code:
Hilo("#clickMe").click(function() {
Hilo("#content").html('Hilo Wald');
});
Both gives you the exact same compatibility with same efficiency but which one do you think is better?
Hilo is designed to be used by both professional and beginner JavaScript programmers. And you don't even need to know much about JavaScript to learn or understand Hilo.