Edit::
Thanks Everyone for being helpful, but I tracked my problem as <script src="jquery.js" />
instead of <script src="jquery.js"></script>
. Please vote to close
Any idea why
$(function(){
$(document).keydown(function(evt) {
alert('Hello');
});
})
is not working? I am using Firefox 3.6.13
on Ubuntu 10.10. Well I copied it form here.
Use delegate()
:
$(window).delegate('*', 'keypress', function (evt){
alert("erm");
});
Use
jQuery(document).bind('keydown', function (evt){
alert('Hello');
});
You may test if quick using firebug console (run it). You now get an alert box everytime you push a button on the document. I used Firefox 3.6.13 to verify this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With