Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Thursday, April 13, 2017

JavaScript is evolving into a true Object Oriented Language

New OOP features of JavaScript

Working Sample

class Human {
  constructor(name, gender) {
    this.name = name;
    this.gender = gender;
  }
 
  static getGenderFemale() {
    return "female";
  }
 
  static getGenderMale() {
    return "male";
  }
}

class MaleHuman extends Human {
  constructor(name) {
    super(name, Human.getGenderMale());
  }
}

class FemaleHuman extends Human {
  constructor(name) {
    super(name, Human.getGenderFemale());
  }
}

var jack = new Human("Jack", Human.getGenderMale());
console.log(jack);

var peter = new MaleHuman("Peter");
console.log(peter);

var sarah = new FemaleHuman("Sarah");
console.log(sarah);

Sunday, July 24, 2011

Google Closure Book


Closure: The Definitive Guide

Tools for adding power to your JavaScript



















Friday, July 16, 2010

Ajax Activity Indicator without GIF Animations



Do you need a non-image Ajax activity indicator?
Try ActivityIndicator class of Ajax Islands framework. Take a look at this tutorial.

Thursday, July 15, 2010

function functionOne() vs functionTwo = function()

Do you know the difference between these two syntax in Javascript:

function functionOne() {
  //function body
}

functionTwo = function() {
  // function body
}

var funcionTwo = function() {
  // function body 
}

Just check this thread. :)

Tuesday, June 22, 2010

jQuery In Action 2010


Do you need this fantastic book?
Download both editions (2008, 2010) here.

Thursday, May 14, 2009

AjaxContent Updated

AjaxContent class, second island of Ajax Islands project, updated!
Please check it out and take a look at new feature, loaderContainer.

I'm waiting to receive your feedback.

Friday, December 12, 2008

AjaxImageReflection

I developed the 5th island which is not actually an Ajax component but DHTML component. Using it you can add nice and customizable reflection effects to IMGs on your pages; Only if your browser supports HTML canvas. It means it doesn't work in IE7.
Something like this:

Go ahead and take a look at examples here. You can download it too.

Sunday, November 16, 2008

JavaScript Object Model - OO Programming


JavaScript is a C++-like scripting language and like most of its relatives let the programmers to write in both object oriented and procedural style. But there is a big difference between JavaScript and other popular OO languages such as C++ and Java which are class based languages.
OO languages are either class based or prototype based. JavaScript is one of prototype based languages out there.
There are lots of references and tutorials about OO programming in JavaScript in the Net. Most of them are so useful and explain a single aspect of OO programming in the language. Some are based on a particular framework such as Prototype, JQuery ... while some explain the pure JavaScript rules.If you are curious to read yet another nice article about JavaScript Object Model, I strongly suggest you to spend 15 minutes to read JavaScript's class-less objects by Stoyan Stefanov.
The article explains the dynamic features of the JavaScript and explains different ways to implement inheritance in the language and then compare them with Java's way.