samedi 28 avril 2018

jquery click event with reload

i was wondering why this code: $('.button').click(window.location.reload) triggers illeagal invocation. and this code :

$('.button').click(function(){
 window.location.reload()
 })

works fine.

I don't the difference and why only the latter works.

Thanks in advance!!




Aucun commentaire:

Enregistrer un commentaire