Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva

Some useful Javascript Snippets 


Some useful Javascript Snippets 


Test Var Undefined and default argument

Test Var Undefined and default value for argument

if (typeof variable ==='undefined') {
   // your code
//  the following function has the last 2 arguments nont mandatory
function bymanHeightEqual(pElementMain, pElementCompare, pHeight, pHeightPlus ) {

// default value for arguments not mandatory
pHeight=pHeight || "higher";
pHeightPlus=pHeightPlus || 0 ;


URL Contains

Search in the URL

// Search in the url


How Many Days in the Month

Days in a month

function getDaysInMonth(m, y){return/8|3|5|10/.test(--m)?30:m==1?(!(y%4)&&y%100)||!(y%400)?29:28:31;}


URL Address Null


URL like #

// url will be more or less like effect


Define an Object


Define an Object

// simple object
var myObject={};


To Be continued

To Be Continued... 

Stay tuned, I will add more snippets soon...


DISQUS - Leave your comments here