Author Archive

Mistakes On Chain Assignment In javascript

Sep 30, 2011 No Comments by Mahdi Pedram

One common mistake that I see developers do is exposing a variable to the Global object in chain assignment.
first I let’s see how can you expose a variable to the Global object by accident.
 
function test(){
a =12; // var is missing
return a;
}
test();
 
By missing the keyword var even though variable a is inside of the function but [...]

javascript Read more

Namespace in jQuery

Sep 27, 2011 No Comments by Mahdi Pedram

I have implemented a jQuery plugin that will take care of namespacing for us.
if you don’t know what is namespace please read it from here
take a look at the code below. and see how it works. you can get the code from jsfiddle as well
$.namespace("liteframe.actions.controller");
//OR [...]

Uncategorized Read more

Removing elements from an array in javascript

Sep 27, 2011 No Comments by Mahdi Pedram

If you are trying to remove elements from an array. and do not care what those elements are, you shouldn’t use array slice, array splice.
however there is an easier way of doing this.
by just changin the length of an array we can modify our array and remove items from it.
 
var arr = [1,2,3,4,5];
arr.length = 2;
console.log( [...]

javascript Read more

Repeating a string without using a for loop in javascript

Sep 27, 2011 No Comments by Mahdi Pedram

Even though it is not recommended to use Array constructor. but sometimes we can get some usage of it.
One good example would be repeating a string without using a for loop.
in this example we are creating an empty array with default undefined values.
( when you specify a size for an array, without setting the values [...]

javascript Read more

Securing Undefined Variable In Javascript

Sep 26, 2011 No Comments by Mahdi Pedram

Sometimes some bad programmer or some hacker messes up with the undefined global variable in javascript.
so why would we really care about it.
the following are some examples that the variable undefined will be returned
 
 
var myVar = undefined; //Anything that has been set to the value of undefined.
 
function test(){}; console.log( test() ); // returns undefined – [...]

javascript Read more

Type Casting In Javascript

Sep 26, 2011 1 Comment

I see a lot of confusion among the javascript developers when it comes to casting in javascript.
Casting To A Number
let’s say you have a String and you want to convert it to a Number. one would say I will use parseInt() or parseFloat().
but there is even an easier way of doing it. no need to [...]

Read more

HTML5 Logo with canvas

Jan 22, 2011 No Comments

As you guys all know, w3c has released a new logo for HTML5
which is really cool they even have made T-Shirts with HTML5 logo on it.
So I was thinking to myself, what’s the coolest thing that I can to promote HTML5 LOGO .
Yeaaah, HTLM5 Logo With CANVAS No Need for any Image .

check [...]

Read more

Object Oriented with jQuery , javascript

Jan 20, 2011 No Comments

javascript is a scripting programming language that also supports Object Oriented Programming by its Prototypical Inheritance nature which is build in to the language.
most of the programmers in the world are used to Classical Object Oriented paradigm, and when they first start to do OO with javascript they will have a hard time.
Today what [...]

Read more

Css3 Button Maker Online Tool

Dec 30, 2010 No Comments

Having an optimize website followed by w3c standards has to be a primary goal for any front-end Developer.
As we all know new browsers support CSS3 and HTML5 partially. it’s really a good idea to master CSS3 and use it on our day to day coding life.
Learning css3 avoids us using most of unnecessary javascript [...]

Read more

CSS3Designer.com has been released

Dec 29, 2010 No Comments

For the past 3 month,our Team has been working on a new project called CSS3 Designer.
Our main goal is to improve web developers and designers general knowledge on CSS3 and HTML5.
Creating a flawless and perfect world on the web for all code lovers is what we want

How we Developed Css3designer?

Using LiteFramePHP [...]

Read more