View Single Post
Old 07-10-2009, 03:51 PM   #3 (permalink)
adamdecaf
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

I swear there was a thread like this, but I can't find it.

anyway...

A framework (one word) is a collection of code designed to made coding easier. Frameworks can simplify multi-step processes. They can also make sense of mundane or difficult tasks. The downside is you may have to "learn" a new "language" to use them.

For example jQuery has a very different syntax then regular JavaScript.

javascript Code:
$(document).ready(function() {
     $("a").onclick(function() {
         $(this).css({ color: "red", background: "black"});
     });
});

The same can be done with regular JavaScript.
javascript Code:
function color() {
    var n = document.getElementsById("a");
    var size = n.length - 1, x;
   
    for (x = 0; x < size; x++) {
        n[x].style.color = "#990000";
        n[x].style.backGroundColor = "#000000";
    }

return;
}

    n.addEventListener("click", "color", false);

It's just your preference, companies will often use a framework because it can be more reliable and easier to use.
__________________
My Site
adamdecaf is offline  
Reply With Quote
The Following User Says Thank You to adamdecaf For This Useful Post:
dodgeqwe (07-13-2009)