View Single Post
Old 04-22-2009, 04:45 PM   #9 (permalink)
allworknoplay
The Gregarious
 
allworknoplay's Avatar
 
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
allworknoplay is on a distinguished road
Default

Quote:
Originally Posted by CoryMathews View Post
I would suggest going to w3schools.com and learning how the html dom works. Then javascript will become much easier. But I would not spend to much time with the basic javascript and would jump right into a framework such as jquery.
that's exactly where I've been the last couple of days. I need to learn the fundamentals and get a complete understanding before I jump into a framework. I'm not sure which is a good one out there, there are so many!!

Quote:
Originally Posted by sketchMedia View Post
Well, most languages these days have syntax that look similar to C, including PHP. However with Javascript there are a few things that differ to PHP (well in the current version of PHP in any case) like closures, lambda functions,o bject literals etc

javascript Code:
obj = {
    var : 'test',
    print: function() {
        alert(this.var);
    }
};
obj.print();

javascript Code:
var obj = function () { 
    function doAlert(str) {
        alert(str);
    }
    return { 
        var : 'test'
        print : function() { 
            doAlert(this.var)
        } 
    }
}();
obj.print();
javascript Code:
obj = function(){alert('Self invoked!'); }();
javascript Code:
getName = function(){
        namesArray = ['sam', 'ben', 'john','dave'];
       
        return function(n){
            return namesArray[n];
        };
    }();
    alert(getName(2));
Can't say I agree, I think a good understanding of how the language works (and ultimately how the framework works) is essential for performance if nothing else.
Thanks for the examples, I'll have to break those down and try to understand them. The format looks pretty foreign to me...
allworknoplay is offline  
Reply With Quote