Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- prop



  jQuery to check whether checkbox is checked

In Vanilla JavaScript, the correct way of checking whether a checkbox is checked is to get the property checked of the checkbox. Assuming there is an checkbox with id "checkbox1", below line will return true if the checkbox is checked while it will return false if the checkbox is unchecked: document.getElementById("checkbox1").checked In jQuery, there are a few ways to check this. The first one is to using the corresponding counterpart of the Vanilla JavaScript, it is to check the checked proper...

   jQuery,checked,checkbox,attr,prop     2015-07-25 08:49:54

  Deep clone of JavaScript object

In JavaScript world, it's frequently seen object clone. Normally when creating a clone of an object, it's only the reference being cloned but not all contents. In some scenarioes, it's desired to clone all the content instead of just the reference such that any change made to the cloned object will not change the original object. Differences between shallow clone and deep clone can be as simple as: Shallow clone : Only the object reference is cloned but not the content Deep clone : Clone all co...

   JAAVSCRIPT,DEEP CLONE,DEEP COPY,SHALLOW CLONE,SHALLOW COPY     2016-10-31 00:27:24

  ECMAScript 5 Objects and Properties

ECMAScript 5 is on its way. Rising from the ashes of ECMAScript 4, which got scaled way back and became ECMAScript 3.1, which was then re-named ECMAScript 5 (more details)- comes a new layer of functionality built on top of our lovable ECMAScript 3. Update: I've posted more details on ECMAScript 5 Strict Mode, JSON, and More. There are a few new APIs included in the specification but the most interesting functionality comes into play in the Object/Property code. This new code gives you th...

   ECMAScript,Object,Property     2012-01-29 04:38:50

  Can a === 1 && a === 2 && a === 3 be true in JavaScript?

Lots of you may be aware that there is famous interview question which asks whether a == 1 && a == 2 && a == 3 can be true in JavaScript. And the answer to this question is YES. The reason is that == will do a non-strict comparison which will evaluate a to a number and this provides the possibility of dynamically return the value when every time a is accessed. Have you ever wondered whether a === 1 && a === 2 && a === 3 can be true? At first glance, it seems this ...

   JAVASCRIPT,===,STRICT COMPARISON     2018-04-06 12:17:29

  The Basics of jQuery

So, a while back I had an internal presentation at work about this topic. A few good friends in the community took a look at my slides, and they thought it would make a nice blog post because “there can’t be too many good posts about jQuery introduction and best-practices.” Whether this post is going to be good or not, is up to you but I’ll try to outline what jQuery is, and how you can start working with it. For most of you, this will just be a re-cap and probably...

   JavaScript,jQuery,Framework,Basic     2012-03-01 04:57:18

  CSS3 Animation With jQuery Fallbacks

In today's post, we'll be taking a look at how you can use CSS3 transitions to power your application's animations with jQuery's .animate() method as a fallback where transitions aren't supported. The benefit of transitions is that unlike JavaScript based animations, they're hardware accelerated in certain browsers and mobile devices, resulting in a potentially smoother overall animation than you would normally experience. In a lot of cases your code will work seamlessly with the solut...

   CSS3,Animation,JavaScript,jQuery,Demo     2011-08-19 08:10:58

  API Design is UI for Developers

I’ve been thinking a lot about APIs and their design recently.I stumbled on this fantastic quote from Greg Parker: A programming language is a user interface for developers. Language authors should learn from HCI principles.22/02/2012 19:10 via webReplyRetweetFavorite@gparkerGreg ParkerWhen I first started learning C++ (back in the bad old days) I was convinced that any 1st year student could design a better programming language. One which behaved in a sane fashion without a lot of le...

   API design,UI,developers,PHP     2012-03-11 13:21:43