cursed Posted January 23, 2008 Share Posted January 23, 2008 Why doesn't this work? I think I'm overlooking something stupid ??? function unicodeToText(event) { var asciitext = ""; asciitext = String.fromCharCode(event.keyCode); makeRequest('http://test.com/index.html?receive=' + asciitext); } assume that the ajax process is after this, and that index.html could receive the stuff that javascript is giving to it Thanks in advance! Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 23, 2008 Share Posted January 23, 2008 I think this is what your wanting; but I am not completely sure. Try it out and see if it's what your looking for: <script language="JavaScript"> function unicodeToText(e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; var asciitext = String.fromCharCode(keycode) makeRequest("http://test.com/index.html?receive="+asciitext+""); } </script> </head> <body onkeypress="unicodeToText(event)"> Quote Link to comment 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.