goodstuff22 Posted December 25, 2010 Share Posted December 25, 2010 How does putting event in a onkeypress function call reference to the current event? <img src="blah.png" onkeypress="blahblah(event);"> function blahblah(e){ blbalhlablahlalb } is the event a reserved keyword when calling a function or something? Quote Link to comment https://forums.phpfreaks.com/topic/222640-onkeypress-event/ Share on other sites More sharing options...
requinix Posted December 25, 2010 Share Posted December 25, 2010 No, "event" isn't a reserved word. Just like how "window" and "document" are variables with values defined for you, so is "event". But it depends on the browser, last I knew. Sometimes you can get it globally, sometimes you can get it from the event handler, sometimes you can get it from the window. Quote Link to comment https://forums.phpfreaks.com/topic/222640-onkeypress-event/#findComment-1151394 Share on other sites More sharing options...
.josh Posted December 25, 2010 Share Posted December 25, 2010 would help if you explained what exactly it is that you're trying to accomplish. Quote Link to comment https://forums.phpfreaks.com/topic/222640-onkeypress-event/#findComment-1151400 Share on other sites More sharing options...
goodstuff22 Posted December 26, 2010 Author Share Posted December 26, 2010 I'm just trying to understand how events work. What is the difference of calling the event object globally in the function, or in a on event thing? For example, onkeypress="blah(event);" what happens when u do that? Quote Link to comment https://forums.phpfreaks.com/topic/222640-onkeypress-event/#findComment-1151569 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.