devendra's public fiddles
-
BbdvR
jQuery 1.7.1, HTML, CSS, JavaScript
-
Partial Application Using Currying
The method is degined such that if it gets incomplete arguments it will return a funcion to accept other arguments not supplied yet
-
Function Application
Mootools 1.4.4, HTML, CSS, JavaScript
-
Immediate Function
This patter can be used to create namespace Other names for the immediate function pattern include “self-invoking” or “self-executing” function, because the function executes itself as soon as it’s defined.
-
Self-Defining Functions
Another name for this pattern is “lazy function definition,” because the function is not properly defined until the first time it’s used and it is being lazy afterwards, doing less work.
-
ReturningFunction and Closure
Advantage of Closure it creates a closure, and you can use this closure to store some private data, which is accessible by the returned function but not to the outside code.
-
Callback Pattern
Mootools 1.4.4, HTML, CSS, JavaScript
-
Inheritance in javascript
Step 1 invoke the constructor of supercalss Rectangle.call(this,w,h); step 2 changing the prototype link DepthRectangle.prototype = Rectangle(); 3. changing the prototype to point back to constructor of DepthRectangle DepthRectangle.prototype.constructor = Depthectangle;
-
Overriding object methods
The base of all object is Object in javascript.ie every one inherits properties and method from Object Overriding Cruical ones is important
-
Defining class level methods
Using Function Declaration to create a new object. Adding methods to prototype so that its accessible to every instance
-
Function Hoisting
Trouble in using Function Declaration
-
Types of Function in javascript
Function exist in two form in javascript 1} Function Expression (aka Function Literal) 2} Function Declarations
-
Throwing an Error
Exception Handling in JavaScript
-
Working with JSON
JSON is a data interchange format very fast than XML . Advantage of JSON is that it can be treated as JavaScript object
-
Checking whether obj is an Array
Arrays are object in javascript var arr = [1,2,4]; typeof(arr); always return object
-
Self Invoking Constructor
This can be used incase you invoke a constructor function without using the new keyword
-
Using new keyword and Understanding Prototype chain
We can create a class like thing in javascript and to create instance of it use new keyword Obviously there is no such thing as class in javascript everything is function.
-
Understanding objects in javascript
jQuery 1.7.1, HTML, CSS, JavaScript
-
Creating module in JavaScript
This pattern allows you to give namespace to you variables and methods so that they dont get globally accessible
-
Peepcode -I
Simole Model and its view