![]() |
|
![]() | ||
|
Subject:
Advanced HTML / JavaScript / CSS
Category: Computers > Internet Asked by: liquid_x-ga List Price: $10.00 |
Posted:
20 Sep 2003 23:22 PDT
Expires: 25 Sep 2003 21:43 PDT Question ID: 258734 |
We are trying to design a complex web-page nested deeply with tables and several I-Frames to serve as a web-based front-end to an open-source on-line game in the spirit of BBS door games. Believing flash is basically evil incarnate, there are three things we would like to be able to do with style-sheets or JavaScript if possible: o How can we set a page background color to be black before the HTML is loaded when a link is followed (or a page is being reloaded)? Before the HTML is loaded the background flashes white (which might be a browser-default). As our background is black, this doesn't look good. Is there a way to fix this? o We would like to have an <input type=text> entry box to enter commands which traps the up arrow/down arrow keys to provide a command history, think of pressing up/down in bash for an example. AccessKeys can be used to bind certain modifier keys (http://www.htmlgoodies.com/tutors/accesskey.html) but we can't seem to find a way to bind up arrow/down arrow keys. Is this possible using AccessKeys? If not, the link provided mentions you can accomplish the same thing using JavaScript? o Is it possible to MD5 (or other hash mechanism) a string of text in an input box (like a password) before it is sent to the web-server? This would add a layer of security to user passwords as we never really need to know them, only their MD5. The information isn't nearly important enough to go through the trouble of SSL but would still like to do this if possible. | |
| |
| |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Advanced HTML / JavaScript / CSS
From: eldad9-ga on 21 Sep 2003 00:30 PDT |
Regarding the MD5 question: You can find Javascript functions to calculate checksums (MD4/MD5/SHA) at: http://pajhome.org.uk/crypt/md5/ Now what you want to do on the form is something like <form name="myform" action="my.cgi" method="post" onsubmit="return obfuscate()"> include in your html the following: <script language="JavaScript" src="md5.js"></script> (or whatever you decide to use) And add a javascript function: function obfuscate { document.myform.passwordfield.value = hex_md5( document.myform.passwordfield.value); return true; } Remember, this is not encrypted, just obfuscated. Make sure to use the POST method and not GET, to prevent caching or logging of the URL. For your key up/down problem, you need to trap the onkeydown or onkeypress events; if the target is your text field and the keys are up and down, change the textfield.value to the appropriate entry, otherwise let the browser handle the event. You may come across incompatibilities between MSIE and Netscape that require getting the key code in a slightly different way. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |