Saturday, July 28, 2012

Why $.extend(someObj, anotherObj) Might be Dangerous!

You often have the need to merge two objects. A common use case is that of combining parameters for a $.ajax call. jQuery has a nice function for that, namely jQuery.extend. The function definition is something like jQuery.extend(target, [object 1], [object 2]). But attention, this might have dangerouse side effects if not used properly!Suppose you have an object, obj1 defines like

...

Source: http://feeds.dzone.com/~r/zones/css/~3/ksNApsS8huU/why-extendsomeobj-anotherobj

Sacramento Logo Design Sacramento Web Design Sacramento SEO Sacramento Graphic Design Sacramento Ecommerce Website Design

No comments:

Post a Comment

Blog Archive