Google Answers Logo
View Question
 
Q: Advanced HTML / JavaScript / CSS ( No Answer,   1 Comment )
Question  
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.

Request for Question Clarification by filian-ga on 21 Sep 2003 07:21 PDT
Hello liquid-x,

Regarding the background, do you have a background graphic defined? Or
do you have the page background itself set to #000000 ?

Thanks,

Filian-ga

Clarification of Question by liquid_x-ga on 21 Sep 2003 07:39 PDT
The page comprises of many iframes, this is why the flashing is
annoying in the first place..
One of the iframes has a centered background image.. One of them is
slightly off-black, and the rest are just #000000.

Clarification of Question by liquid_x-ga on 21 Sep 2003 07:44 PDT
An example or reference of usage for trapping up/down arrows such as
'eldad9-ga' described in his comment would be great.  Cross-browser
compatibility is a high priority.
Answer  
There is no answer at this time.

Comments  
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.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

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 Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy