Community Member Profile
- Profile: /members/5627-Drew-Wells.htm
- URL: http://drewwells.net/blog
- Twitter: @coldfuser
- FaceBook: http://www.facebook.com/wells0
- Comments: 54
- Points: 748
Recent Blog Comments By Drew Wells
-
Cross-Origin Resource Sharing (CORS) AJAX Requests Between jQuery And Node.js
Posted on Feb 10, 2012 at 11:30 AM
After you understand the concepts here, this is an awesome cheatsheet for enabling CORS in just about anything http://enable-cors.org/... read more »
-
Using jQuery As A Named Module In RequireJS
Posted on Nov 17, 2011 at 9:31 AM
How about showing how you require jquery from a cdn. @ Mr. Burke, Does this work work with r.js? I've traditionally had issues when building with code outside define calls.... read more »
-
Global Events vs. Entity-Bound Events In JavaScript Application Architecture
Posted on Nov 2, 2011 at 11:18 AM
Check $.Callbacks http://addyosmani.com/blog/jquery-1-7s-callbacks-feature-demystified/ Maybe that will push you off the fence... read more »
-
Experimenting With Sub() And Deferred Objects In jQuery 1.5
Posted on Sep 20, 2011 at 5:06 PM
Use .pipe() to chain multiple (dynamically retrieved) ajax requests ie. .when(ajax1).when(ajax2).pipe(function( ajax1, ajax2){ if( ajax1.more ){ //omg need more return $.when( ajax1.more ) } }).then( /*all done*/ ); Here's something I wrote in case... read more »
-
Javascript's hasOwnProperty() Method Is More Consistent Than The IN Operator
Posted on Aug 31, 2011 at 10:39 AM
True, hasOwnProperty() is used to distinguish actual properties of an object from those in the prototype. https://developer.mozilla.org/en/JavaScript/Reference/Globa... read more »
-
Trying Out LAB.js For Asynchronous JavaScript (Script) Loading
Posted on Jul 19, 2011 at 9:11 PM
Just from taking a gander at your code, it was a bit scary everything modified the global. Have you looked at RequireJS? With RequireJS every file is at most one module, and no file isn't a module (or shouldn't be). A module is in the most simple since a file containing a single define fu... read more »
-
Branching Logic vs. Guard Logic When It Comes To Function Control Flow
Posted on Jun 23, 2011 at 11:26 PM
@Elliott, I wanted to test returns inside a function, I can't test those without paying the cost of opening a function :P. So obviously, calling a method costs far more than premature returns 'guarded logic' inside it. Of course, some code that requires no if/then/else would be faste... read more »
-
Branching Logic vs. Guard Logic When It Comes To Function Control Flow
Posted on Jun 23, 2011 at 11:21 PM
@Elliott,... read more »
-
Branching Logic vs. Guard Logic When It Comes To Function Control Flow
Posted on Jun 23, 2011 at 11:15 PM
@Elliott, Math.random() probably is affecting the performance, but so is the function call itself. Branching logic has a major impact on performance this was just not a good test of it. A true test would remove the function call as well.... read more »
-
Branching Logic vs. Guard Logic When It Comes To Function Control Flow
Posted on Jun 23, 2011 at 10:54 PM
I know you tackled this question in ColdFusion, but I just had a revelation that this could kill JS performance and jsperf confirmed it: http://twitter.com/#!/oneguystudio/status/84091367088852992... read more »
-
JavaScript Web Applications By Alex MacCaw
Posted on May 30, 2011 at 12:46 PM
There are no classes in JavaScript or the class keyword wouldn't throw an error... somebody famous should rename objects used to create other objects to create less confusion on the topic... read more »
-
Using JavaScript's With Keyword To Create A Dynamic Scope Chain For Method Execution
Posted on May 27, 2011 at 5:56 PM
Crockford said with was bad, so let's do the exact same thing with catch! try{ new Throw() } catch ( scope ){ //Woohoo! }... read more »
-
Javascript: The Good Parts By Douglas Crockford
Posted on May 19, 2011 at 10:00 AM
@WebManWalking, Yeah with is interesting and I must say I rarely use it, because of fear over it's downsides. However, it is used heavily in Firebug. Zakas and Crockford also defer on JSLint, Zakas seems to given up the fight for Lint and switched to using JSHint: read more »
-
Javascript: The Good Parts By Douglas Crockford
Posted on May 19, 2011 at 1:40 AM
I agree it's well written and he expresses his thoughts. It came with too any opinions instead of insights into the language. I liked the train diagrams, but I didn't like his opinions on code structure. Every if should have a block {}, but i++ is much more readable than i = i + 1. The n... read more »
-
Object.create() Improves Constructor-Based Inheritance In Javascript - It Doesn't Replace It
Posted on May 3, 2011 at 12:25 PM
@Ben, I feel like I need to skim over the ECMASCRIPT references to see if I'm even correct here. From what I understand, classical inheritance was added to the language after initial implementation. It does a lot of prototype/constructor setting internally to make things work with the Pro... read more »
-
Object.create() Improves Constructor-Based Inheritance In Javascript - It Doesn't Replace It
Posted on May 3, 2011 at 11:09 AM
Did you know Object.create is orders of magnitude slower than new? http://jsperf.com/object-create-vs-constructor-vs-object-literal/7 It seems insane to call `new` a hack... read more »
-
Your Javascript Constructor Logic May Break Prototypal Inheritance
Posted on Apr 28, 2011 at 11:41 AM
@Ben, I don't know enough either, I move from one person's opinion to another. Are there any real answers to things like what is a Factory, Observer, etc? We have the Gang of Four book as an aging reference, then nobody else challenged the ideas from that book just reiterated them...... read more »
-
Your Javascript Constructor Logic May Break Prototypal Inheritance
Posted on Apr 28, 2011 at 11:27 AM
@Ben, I read somewhere that a factory is something that takes a string and creates an Object. This would take an array of args or an object and create a new object. So maybe this is the 'dumb' factory pattern. :)... read more »
-
Your Javascript Constructor Logic May Break Prototypal Inheritance
Posted on Apr 28, 2011 at 11:16 AM
I really need to find a way to rationalize our different approaches to Proto inheritance. My idea involves minimal usage of constructors and more about replacing 'default' properties from inherited objects (I think more like proto style mixins). I would probably do something like this. So... read more »
-
Returning NULL Values In JSON Using SerializeJSON() And ColdFusion
Posted on Apr 5, 2011 at 2:16 PM
@Henry, Nope, I was lucky to find it, otherwise jQuery tries to serialize your data for you. I had the unfortunate experience of debugging this while using a proxy, so after many hours of Wireshark I discovered the issue.... read more »



