Sunday, August 8, 2010

Get event keycode in both Firefox and Internet Explorer

This solution should work in both IE and Firefox.

JS -

function getCharCode(event)
{
var charCode = (event.which) ? event.which : event.keyCode;

// Might want to get the character representation of the Unicode keycode -

var character = String.fromCharCode(keycode);


}

HTML -

Just put an onkeypress="getCharCode(event)" event handeler in your input code (textarea, whatever)

9 comments:

Anonymous said...

Hi, i just want to say hello to the community

Anonymous said...

Be close at hand money respecting the most challenging and rewarding taste of your life. Obtain unsurpassed loyal humanness hazard to teach you for a hasten in filmmaking, acting correct layer, screenwriting, producing, cinematography, 3D spirit or lyrical theatre. You can enroll in a short-term workshop or throw away [url=http://univ-prog.disl.org/] buy cialis[/url] limerick, two or three years dedicated to perfecting your technique, in proclivity to of fitting reading books and attending lectures.

buy generic cialis online said...

Well worth to read this article, thanks for sharing this information. With this article you offered me got a chance to know about this, anyway i say Great Article! and waiting for you next article about this interesting subject.

buy generic viagra said...

I am very much glad to visit your blog..I need this event code..thanks you so much for writing and sharing this code with us!!

How to Lose Weight Fast said...

Good to visit your blog as I get to know good things here especially this code. Thnaks

D said...

Thank u again Andrew for ur tips they are great generic xenical

Anonymous said...

unlock iphone 4
iphone 4 unlock
how to unlock iphone 4

http://emergenturbanism.net/2010/04/how-our-planning-process-prevents-real-planning http://myspeccy.com/en/games/horace-goes-skiing
I have tried downloads, on a variety of computers, which run everything from Windows 95, right up through XP. On every computer that I have ever tried, I have tried to stay on "safe" sites, such as Download.com, to download operations programs, screensavers, and so on (Download.com is just an example, of dozens of so-called web-sites I have tried). Wouldn't you know it, though. At evewry single site, that I can mention, I have brought back viruses, worms, and "tons" of spy-ware. And this is from the "clean", "safe", web-sites. I know that the best hackers can penetrate any connection, including D.S.L., dial-up, and any other connection, to inject bad codes into home computers. How can internet users "safely" use the internet, without having to worry about hackers, and corporations, "injecting" garbage into our computers? Any suggestions would be appreciated.
unlock iphone 4 how to unlock iphone 4

unlock iphone 4 [url=http://unlockiphone44.com]unlock iphone 4[/url] unlock iphone 4 how to unlock iphone 4

Unknown said...

Really Useful..
Thanx..

By :Manojbardhan2009@blogspot.com

SteveBrad said...

I am loving this information so much.Please keep such kind of the information in the future also!!!
Caverta|Edegra|Forzest