Javascript – Debug Object


Buat yang suka kesulitan debug object javascript mungkin bisa menggunakan code dibawah ini :

this dibawah ini adalah object yg dituju

$.each(this, function(index, value) { 
    alert(index + ': ' + value); 
});

Semoga membantu

jQuery – closest() versus parent()


Untuk catatan saja … dapet sumber dari ary bedanya closest and parent. ini copas dari stackoverflow.com yang menanyakan hal yang sama :).
Intinya closest() mulai langsung dari element yg dituju dan mencari sesuai dengan selector dan berhenti jika menemukan satu saja yg sesuai. pastinya lebih cepat dari parent(), namun pastikan element dan selector yg dituju harus uniq 🙂 agar tidak salah. mohon petunjuk juga jika salah. karena baru analisa 🙂

.closest()
Begins with the current element
Travels up the DOM tree until it finds a match for the supplied selector
The returned jQuery object contains zero or one element

.parent()
Begins with the parent element
Travels up the DOM tree to the document’s root element, adding each ancestor element to a temporary collection; it then filters that collection based on a selector if one is supplied
The returned jQuery object contains zero, one, or multiple elements

Semoga membantu,
Sony SM

Thanks to ary

jQuery ver 1.9 mengenai function .attr() versus .prop()


Sudah tau belom nih kawan2 programmer mengenai berita baru di jQuery ver 1.9. Buat yang sering menggunakan jQuery ver 1.9 function attr() akan dirubah jadi prop(). secara function mungkin hampir sama, tapi lebih baik prop(),
karena buat yang sering menggunakan ajax form, pasti akan berhubungan dengan properies spt dropdown box / combo box, checkbox, dan input. dalam function prop() ini sudah mengenali secara langsung checked and selected dengan menggunakan type data bolean (0/1).

Semoga membantu referensi dari saya.
Thanks juga buat ary yg sudah kasih info 🙂

Source : http://jquery.com/upgrade-guide/1.9/#attr-versus-prop-