download copy to my office

Add to:

Doc URL :

Continuous Integration
104 views, 0 comments
What’s New in Silverlight 4 Beta
283 views, 0 comments
Economy + Internet Trends
504 views, 0 comments
UsingAjaxLibrariesAn...
2312 views, 0 comments
Prototype 1.5.0 Chea...
1794 views, 2 comments
Mootools r.83 Cheat ...
1720 views, 0 comments
JavaScript Cheat She...
2219 views, 3 comments
AdobeAIR for javascr...
1342 views, 0 comments

 Javascript Common Mistakes  

Description : JAVASCRIPT COMMON MISTAKES
Dongsu Jang http://blog.iolo.pe.kr

Unaware of: Async! Async! Async!
   

var result1, result2, result3; $.ajax(..., success: function(data) { result1 = data; }); $.ajax(..., success: function(data) { result2 = data; }); result3 = result1 + result2;
But, don‟t do that: “async: false”



Unaware of: this “this” is not the “this”
     

function test(name, button) { this.name = name; button.onclick = function(event) { alert('hello, ' + this.name); }; }

Unaware of: “not of not” is not the not of “not”
      

function test(foo) { alert(typeof(foo)); alert(foo); if (foo) { alert('foo'); } if (!foo) { alert(„!foo'); } if (!!foo) { alert('!!foo'); } }

Misunderstaning 0, null, false, undefined, NaN and “”
      

function test(foo) { alert(typeof(foo)); alert(foo); if (foo) { alert('foo'); } if (foo == null) { alert('foo == null'); } if (foo === null) { aler

Tags: javascript

Rating (0 vote) : 
 
require login to vote.

Some rights reserved. Attribution

779 views,  0  favorites

Comments ( 0 / 600 )