Quantcast
Channel: Clientcide (Formerly CNET's Clientside) » Browser Bugs
Viewing all articles
Browse latest Browse all 10

Beware: object = object has a pitfall

$
0
0
So I spent an entire day discovering a quirk about javascript that I must now share. In a previous post on creating default settings for classes/objects I discussed the following technique: var Widget = new Class({ initialize: function(element, options){ this.element = element; this.options = Object.extend({ offsetX: 0, offsetY: 0 }, options || {}); this.setPosition(); }, [...]

Viewing all articles
Browse latest Browse all 10

Trending Articles