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! Link to comment https://forums.phpfreaks.com/topic/87340-fromcharcode-stupid-question/ 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)"> Link to comment https://forums.phpfreaks.com/topic/87340-fromcharcode-stupid-question/#findComment-446763 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.