10周年のSPコンテンツ!

JavaScriptのベストプラクティス大会 jsEdu

詳細は"10 Free Copies of “JavaScript Patterns” from O’Reilly Books | Nettuts+" http://net.tutsplus.com/freebies/books/10-free-copies-of-javascript-patterns-from-oreilly-books/ 要は #jsEdu つけてJavaScriptのTips投稿してね。の検索メモ。 追記:一部取り出して日本語にしてみました。 続きを読む
JavaScript
13
Envato Tuts+ Code @TutsPlusCode
Tweet a JS quick tip, and hash #jsEdu at the end to enter to win a copy of JavaScript Patterns. http://bit.ly/9xYHyW
Cédric Michaux @he8us
Use auto-executing function -- (function(){ ... })() -- to simulate private functions and variables in Javascript #jsEdu
Kosso 🇪🇺 @kosso
JavaScript versions of many useful PHP functions http://phpjs.org/ #jsEdu cc: @nettuts
David Díaz @Seich
You can use the following notation to create a javascript object: var car = { colour:'red', wheels:4} #jsEdu
Ayman Safadi @aymansafadi
Never bind JavaScript behavior to a link pointing to nothing (e.j. "#"). Always give links a real destination (graceful degradation) #jsEdu
Alexander Vey @dailyway
Use 'e.preventDefault();' and/or 'e.stopPropagation();' instead of 'return false;' #jsEdu
Matt Tortolani @doodlemoonch
Use {} instead of new Object() and [] instead of new Array() #jsEdu
@CavCurt
@nettuts Avoid using the eval() function! #jsEdu --The 14th is my birthday also. Take that into account.
Christopher Webb @conspirator
If you're interested in object-oriented JavaScript, check out my post: http://notes.conspirator.co/post/1269595708/oojs #jsEdu
arjo @arjo
@nettuts Learn to use http://www.jslint.com/ "it will hurt your feelings" ;-) #jsEdu
Sebastian Senf @mustardamus
//JS shortcut for parseInt(): typeof ​parseInt('1') == typeof +'1'​​​ //true (number) #jsEdu
Estevão Mascarenhas @estevaoam
It's obvious but always indent your javascript code correctly. #jsEdu
John Nelson @johncoder
Wrap your javascript code (i.e. jQuery plugins) in a self executing function to limit library collisions #jsEdu http://bit.ly/cnfzlm
Anthony @Johnner
Copy the link to the context of the outer function: "var that = this" and use "that" in closures to access parent function context #jsEdu
Howard 🇬🇧 🇪🇺 @citizen_of_now
In your addressbar, javascript:location=document.referrer; Allows you to go back even when there's no back button. #jsEdu
Ricardo Rodrigues @ricmrodrigues
Use the defer attribute for ie only external scripts #jsEdu
Clément Legrand @lemacbacon
Always put your Javascript at the bottom of the page ! #jsEdu
Ian L. @MrSaints
Avoid using global variables! Use namespaces and follow the trend ;) #jsEdu @nettuts
Ethan Gardner @EthanGardner
use object literals and logical operators to suppress errors and check for namespaces (i.e. window.EDG = window.EDG || {};) #jsEdu
Colm Britton @ColmBritton
Comment, comment, comment. Your code is only a view source away from anyone so educate and help them understand your mind. #jsEdu
Jeremy Clements @jeremy_clements
Keep DOM lookup/access to a minimum, because it can be very expensive; cache elements that will be frequently used. #jsEdu
残りを読む(344)

コメント

azu @azu_re 2010年10月15日
ちょこっと追加。まあこの辺で止めておくか。