Archive for January 25th, 2010

25 Jan 2010 @ 6:42 PM 

JQuery Negation

 if(!$(stuff).length > 5){
   // If element ISNT LARGER THAN 5 so in our case the number of elements must be 0 1 2 3 4 and 5
  $(this).doSomething();
}
else {
 // The number of elements is GRATER THAN 5 // do another thing
}

Basically this is a negation of the following, god damnit my head hurts

 if($(stuff).length < 5){
 $(this).doSomething();
}
else {
 $(this).doAnotherThing();
}

Oh well new day, new learned things. God Bless Amerika

Tags

Tags: , ,

Categories: jQuery

Posted By: Dinulescu Alexandru Adrian

Last Edit: 09 Dec 2010 @ 02:04 PM

EmailPermalinkComments (0)

25 Jan 2010 @ 6:19 PM 

Hello

This post is going to be short and sweet. Basically jQuery 1.4 launched a couple of days ago and i thought i’d move my blog from 1.3.2 to 1.4 and lo and behold JS Error.

I was going like WTF, and after trying to debug it for like 15mins i come to the following conclusion. From my own personal experience, in jQuery 1.3.2 when you wanted something to happen to an element you went like this. Since i use WordPress for as my blogging platform not everytime the .elementClass element was present.

+ Continue Reading This Article

Posted By: Dinulescu Alexandru Adrian

Last Edit: 25 Jan 2010 @ 06:19 PM

EmailPermalinkComments (0)