Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!

SRINI VASAN

Ranch Hand
+ Follow
since Aug 29, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by SRINI VASAN

Hai,

I have a double number 123456789.9999999 . I want to truncate the numbers after teh second 9 after .. I mean i want to give output of 123456789.99.
BUT EVEN WITH OUT DOING ANYTHING , IF I JUST PRINT AFTER INITIALISING , I AM GETTING 123456790.00 ANY SOLUTIONS?
The numberformat patterns, * 100 & /100 , and choping by string does not work since , at the storing time itself the value is rounded off.
PS : Sorry for the CAPS, I have put that just because it gives a illusion that it is simple.
regards,
srini
16 years ago
Hai ,

I am reading a file in JSP on weblogic 6.0 . I am able to refer the file in the application only using the absolute path ( f:\bea\..\pasfl.txt ) . Can i refer the file using the relative path of appserver ( i mean if i put the file in application folder , inside jsp is there any way to access the file like
BufferedReader b= new BufferedReader("\dir\file") ; // <-web path
than
BufferedReader b= new BufferedReader("F:\bea\dir\file") ; // <- Absolute path
regards,
srini
16 years ago
Hi ,
Thanx for sharing the solution .. I thought it is not possible..Sorry for teh wrong advice
regards,
srini
Hi ,
One thing which i am still unclear is how to solve the Z index problem .. Is there any menu builder which dispalys menu both in netscape and IE even if if menu falls in the form elements like list box.
Regards,
srini
Hi ,
I have two list boxes . depending on choice in list box 1 i am selecting the elements in second list box. If the selected item is in the bottom netscape selects the item but never shows at the top . ( IE is fien in it ) ..Can u guys have solution for it ..
Love ,
Srini
I am selecting on of teh options using selected=true.
Hi , I am very eager to know too.. Is there any tool guys .. Or Can some body put document on it .. I am just giving my collection ( I got it from a site ).

May be a bit log post guys .. can u all add to this list.

~~~~~~~~~~~~~~~~~ Difference in Netscape and IE~~~~~~~~~~~~~~~
When writing HTML codes, you have to be aware of the incompatibilities between Netscape and Internet Explorer. The appearance might have a dramatic difference depending on which browser you view it on. We will just cover a few of the tags out there which have different effects on the browsers.
Floating Frames < iframe > < /iframe >:
This tag allows you to place a frame of any size anywhere in your HTML layout just like an image. Floating frames are only compatible on Internet Explorer. When you try to view it on Netscape, the only message that appears on your browser is < iframe > < /iframe >

Multi-Column Text < multicol > </ multicol >:
To get the column styled paragraphs such as those in newspaper articles, you can use the Multi-Column Text tag. This tag lets you split your text into as many columns as desired. To do this, you place this set of tags around your text.
For example, < multicol cols="3" gutter="25" > Your text < /mulitcol >
 cols = number of columns
 gutter = space between column
This tag works on Netscape but not on Internet Explorer. Internet Explorer will just display the text, within the set of tags, on the screen without columns.
Marquees < marquee > < /marquee >:
This tag scrolls your text across the screen. The marquee tags are only compatible on Internet Explorer. Netscape will just ignore this tag and place the text within as plain text. Overuse of this feature will get readers annoyed. So, think before using it.


Spacer < spacer attribute1="..." attributes2="..." > < /spacer >
This feature allows you to create some white spaces within a line of text. Attribute such as type=block is only compatible on Netscape. Other attributes you can place inside this tag include align, height, size, type, and width. This tag can be used for horizontal or vertical spacing. It can also be used as a "tab" for starting a paragraph of text.
Color of Horizontal Rule < hr color=color > </hr>
This tag allows you to specify the color of the horizontal rule. This feature is only works on Internet Explorer. The color will not display on Netscape.
Table < table attribute1="..." attribute2="..." attribute3="..." > < /table >
Here are some table attributes that do not work on Netscape:
background=url
bordercolorlight=color
bordercolordark=color
frame=type
rules=edges
These attributes are only compatible with Internet Explorer, but not Netscape. Background lets you choose the background image to put in the table. Bordercolorlight allows you to specify the lighter color used in creating 3D borders independently. Bordercolordark allows you to specify the darker color used in creating 3D borders separately. Frame lets you specify which side of the table's outer border to be displayed. Rule specifies which inside borders to be shown.


Significant Features

Between the two browsers, Netscape Navigator and Internet Explorer, there are a few significant features in each of them. We would only mention a few of them here because as the companies constantly upgrade both browsers, there would be more differences later. If you know all these features already, then GREAT, you are certainly an explorer; but if you are not too familiar with the two browsers, these features are worth to know.
Bookmark:
We all like the Bookmark feature in Internet Explorer and Netscape Navigator. Using the Bookmark feature, we can avoid the trouble of typing in long website addresses, especially the ones we frequently visit. What would you do if you have a website address saved on Internet Explorer but you want to view that website on Netscape Navigator? The common way to do that would be open Internet Explorer, look up the website address in the Bookmark, open Netscape Navigator, type in the same address (or using copy and paste). It's kinda inconvenient huh? Well, the feature we are going to introduce here would definitely make this easier for your life. In Internet Explorer, you can import or export your saved bookmark from or to Netscape Navigator. However, this only can be done in Internet Explorer. To do that, you just choose "Import and Export" from the File menu in Internet Explorer (as shown below) then follow instruction.

Language Encoding:
For most people in the US, English is their first language. But when learning a foreign language one might want to visit a foreign website to test their understanding of the language, for example, Chinese, Japanese, Korean, etc. Even though you can find an application to download from the Internet to encode the language of the website, it's inconvenient and time consuming. Microsoft has been very thoughtful of this issue, and therefore developed a language encoding function in Internet Explorer to avoid the trouble of downloading and running of such applications. To do that, you can go to the View menu and select "Encoding" as shown below. It can encode more than 30 different languages!!!

Print Preview:
Well, don't uninstall your Netscape Navigator yet. There is one feature that Netscape Navigator is able to do but not Internet Explorer (yet). That's the feature of Print Preview. When we visit a website and decide that we want to keep a hard copy, we often choose to print it out. But how many pages are there going to be? Who knows? With the feature of the Print Preview in the Netscape Navigator, you would be able to tell and see the exact format as the website is in print. Therefore, you can always change your mind if you know that it doesn't look cool when the web page is in print. Don't forget this function next time when you decide to print something. Trust me, you can save a lot of paper and money from your Husky Card (personal experience!). Of course we will show you how it can be done:
You can certainly do a ONE-page preview........
Or a TWO-page preview!



CSS
When writing CSS stylesheets, you have to be aware of the incompatibilities between Netscape and Internet Explorer. Depending on which browser you view it on, the appearance may have dramatic difference . We will cover just a few of the CSS properties out there which have different effects on different browsers. To view a complete list of CSS incompatibilies in different browsers you can check out the Master Compatibility Chart by Eric Meyer.
Height Property
The height property in the CSS stylesheet allows the program to specify an uniform height for all the images in the same style class. For the code below, the height property reduces the size of the image to 50 pixels. The height property works on Internet Explorer, but not on Netscape.
Overline Property
The overline property in CSS places a line above the tagged sentences. This property works for Internet Explorer, and again, not for Netscape.
Bottom-Margin
The Bottom-Margin property in CSS sets the margin spacing at the bottom of the page. This property works in Netscape but not in Internet Explorer. The text goes right to the bottom in the Internet Explorer Browser.
Box Properties
The border-colors set in ul will create a solid box above the inclosed content. This is presented below by the blue box above the text. This border property is ignored by Internet Explorer but works under Netscape.
The border-colors set in h1 will create a border around around the contents within the heading. This will give the effect of the purple box below. Header borders work in the Internet Explorer browsers but not the Netscape one.
The border-colors set in p will create a solid box to the left of the inclosed content. This is presented below by the blue box to the left of the text. This border property is ignored by Internet Explorer but works under Netscape.
 ul {border-color: blue; border-top-width: 0.5in;} -->ignored by Internet Explorer
 h1 {border-color: purple; border-style: solid;} -->ignored by Netscape
 p {border-color: blue; border-left-width: 3em; border-left-width: 3em} -->ignored by Internet Explorer
Make sure the order of tags in your HTML file is consistent with the order of the tags in the CSS file because the browser, especially Netscape, may not be able to recognize and follow.



TagsNetscapeInternet Explorer
Floating FrameNoYes
Multi Column TextYesNo
MarqueesNoYes
SpacerYesNo
Color of Horizontal RuleNoYes
Background for TableNoYes
Bordecolorlight for TableNoYes
Bordercolordark for TableNoYes
Frame for TableNoYes
Rules for TableNoYes
On the CSS section, we covered a few of the properties, they are height property, overline property, bottom margin, and box properties. Through the testing we have done, we realized that both browsers are trying to work closely with CSS but Internet Explorer seems to do better in most properties. There is a lot of testing to do in CSS, and it is also endless. Instead of showing you every single test, we rather offer you something that is already done on the Internet. That is the Master Compatibility Chart by Eric Meyer. However, in here, we would like to stress that the chart by Eric Meyer is not completely reliable because CSS depends on a lot of other factors, including how one arranges and inserts his or her codes. Again, the chart is for reference ONLY!
Both Netscape Navigator and Internet Explorer are good browsers for just surfing the Internet and viewing web pages. It doesn't really matter which one you use. However each has advantages over the other. Netscape Navigator has some advantages over Internet Explorer. The biggest advantage is that Netscape Navigator supports more platforms or operating systems than Internet Explorer. Internet Explorer will only run on Windows 95/98, Windows NT, and a specific version of Mac OS. Netscape Navigator runs on both of these platforms, as well as Windows 3.1, Macintosh, and several Unix platforms. Both Netscape Navigator and Internet Explorer support the more popular HTML extensions. Also, Netscape Navigator can run all of the Netscape plug-ins, whereas Internet Explorer can run only some of them. Internet Explorer however, has introduced a new technology, called ActiveX, to replace Netscape's plug-ins. Although this technology is easier to use, plug-ins are more widely used and are more readily available.
The reason that Internet Explorer seems to be more outstanding than Netscape Navigator is because it has a better user interface and is easier to use. Netscape Navigator on the other hand has a better news and email system. When talking about performance, Netscape Navigator is faster at loading pages, but Internet Explorer can reload web pages stored in the computer's memory and display large graphics more quickly. On the other hand, Internet Explorer is faster at running Java, a language used to animate web pages. Even though the level of security Internet Explorer has for sending information over the web might not be as good as Netscape's, it is decent and also has options that make it easier for parents to screen what is seen.

Another difference between Netscape and Internet Explorer is in the implementation of content positioning. Netscape uses the LAYER tag while Microsoft bases its approach on a combination of Cascading Style Sheets (DIV and SPAN tags), Active X, its own Document Object Model.
 Don't use the WORD-SPACING property, as it is completely ignored in Internet Explorer.
 Internet Explorer does not accept the PRE modifier for WHITE-SPACE (which kind of defeats much of the purpose for using it).
 Netscape Navigator 6.0 does not understand the NONE value for the CLEAR property, though it understands the rest.
 While Internet Explorer 5.5 manages to pass all of the standard tests for the FLOAT property, it fails to pass the infamous FLOAT "acid test"--which, as part of the CSS1 Test Suite, can be found at http://www.w3.org/Style/CSS/Test/current/sec5526c.htm -- so be wary of using it extensively.
 LIST-STYLE-TYPE is problematic in Opera 5.0.1. Ditto with the WORD-SPACING property.
 Internet Explorer 5.5 seems to have some problems discerning the proper cascading order when multiple @IMPORT statements are used.
 When using ID as a selector, make sure you use the same case for specifying it, as Netscape Navigator 6.0 will interpret ID="GREEN" and ID="green" differently (when it shouldn't).
 Beware using large images with LIST-STYLE-IMAGE, is they may be chopped at the browser margin is displayed in Netscape Navigator 6.0 and Opera 5.01.
 BORDER-STYLE works in all of the major browsers, but note that BORDER-STYLE: DOTTED produces square "dots" in Netscape Navigator 6.0 and Opera 5.01, and filled circles in Internet Explorer 5.5.
 All of the major browsers have problems with the FONT-WEIGHT property. Weights from 100 to 300 are all rendered the same and FONT-WEIGHT: BOLDER does not appear to work in Netscape Navigator 6.0 or Internet Explorer 5.5 (though it does work in Opera 5.01).

T
he difference between the two main browsers is a philosophical one (at base) so it is likely that both will continue into the forseeable future. It is the difference in outlook between the "tortoise and the hare".
The two main characteristics by which we might classify a browser are:
 Coverage
 Speed
By coverage I mean "What possible types of Web pages can the browser display?"
Here, Internet Explorer wins easily. I have 'pressed' the capabilities of each to their limit and find that Netscape 'poops' out long before IE 3.02. It will display things (particularly in frames) that Netscape chokes on. Clearly, Microsoft has chosen to be 'more thorough'. It upholds the logic of html to a much tighter degree and so can go the 'extra mile'.
Internet Explorer is the tortoise.
Speed is another matter. Netscape wins hands down. If it can display the page at all ... it will display it faster than IE3. Apparently, those at Netscape are willing to sacrifice some measure of functionality in exchange for speedy display of the preponderance of pages offered on the internet.
Netscape Navigator is the hare.
Internet Explorer 3.0 takes forever to load from disk. It takes forever to 'decide' what to do with a frame page it encounters. Netscape Navigator 3.0 loads fast and puts up a simple frame in a couple seconds seeming not to have to figure out what to do with it, merely trusting that it will be uncomplicated. The impression I get is that Microsoft has told its programmers to subsume more possibilities than Netscape and so requires more code to load and check through.
If you want to put lots of, or big animations on a page your best bet is to view it with IE 3.+ and not with Netscape. I recently had to remake my largest page (~320K with gifs) to accomodate Netscape users because the animations running behind the view screen in that page were causing Netscape problems (writing to hard drive, swapping, etc.). There were however no problems with my copy of IE3.02.
I have always found myself trying to stay within the boundaries of Netscape but not IE.
Again, the difference is a legitimate one of philosophy. Netscape wants the greatest speed for the most users. Internet Explorer wants the greatest coverage of the "yet to be written web pages" as well as those already here.
Both viewpoints are important and the goals are equally laudable. For this reason, they are both likely to be around for a long time to come. So if you want speed ... go with Netscape. If you want to do big, complicated things ... go to Internet Explorer.
I personally use both equally depending on whatever ...
Actually, I often use three browsers at the same time.
 Netscape Navigator 3.0
 Internet Explorer 3.02
 And that AOL "thing"
I have to use the AOL thing to send e-mail since AOL does not support email from outside its "truncated" window. However, they do make it easy to use another browser. You just 'open it separately' and go.
Example:
In IE you can color <td>'s. In Netscape you can't.
For some insights into browsers and their ways, see for example "Professional JavaScript" ISBN 1-861002-70-X.

Hi ,
I guess my subject of question explains my proplem.. Do i need to delete the wl_do_not_delete folder. For teh changes i make in webapp , i am not seeing it until i delete the folder.

regards,
srini
16 years ago
Hai,
For Network secuirty in Java ther eis a wonderful book called JAVA NETWORK SECURITY which teaches u about secuirity in java. In case if u dont wanna read too much see teh code which i saw it in a website for MD5 .. I donno how tough the algorithm is..
Give it a try ..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0055)http://www.geocities.com/SiliconValley/7116/jv_md5.html -->
<HTML><HEAD><TITLE>MD5 Message Digest algorithm in Javascript</TITLE>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<SCRIPT>
<!--//--><H4>You don't have a Javascript capable browser. </H4>
<!--//-->Then you won't be able to test this code. However, you
<!--//-->can still download it.<BR><BR><HR>
<!--
/*
* md5.jvs 1.0b 27/06/96
*
* Javascript implementation of the RSA Data Security, Inc. MD5
* Message-Digest Algorithm.
*
* Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
*
* Permission to use, copy, modify, and distribute this software
* and its documentation for any purposes and without
* fee is hereby granted provided that this copyright notice
* appears in all copies.
*
* Of course, this soft is provided "as is" without express or implied
* warranty of any kind.
*/
function array(n) {
for(i=0;i<n;i++) this[i]=0;
this.length=n;
}
/* Some basic logical functions had to be rewritten because of a bug in
* Javascript.. Just try to compute 0xffffffff >> 4 with it..
* Of course, these functions are slower than the original would be, but
* at least, they work!
*/
function integer(n) { return n%(0xffffffff+1); }
function shr(a,b) {
a=integer(a);
b=integer(b);
if (a-0x80000000>=0) {
a=a%0x80000000;
a>>=b;
a+=0x40000000>>(b-1);
} else
a>>=b;
return a;
}
function shl1(a) {
a=a%0x80000000;
if (a&0x40000000==0x40000000)
{
a-=0x40000000;
a*=2;
a+=0x80000000;
} else
a*=2;
return a;
}
function shl(a,b) {
a=integer(a);
b=integer(b);
for (var i=0;i<b;i++) a=shl1(a);
return a;
}
function and(a,b) {
a=integer(a);
b=integer(b);
var t1=(a-0x80000000);
var t2=(b-0x80000000);
if (t1>=0)
if (t2>=0)
return ((t1&t2)+0x80000000);
else
return (t1&b);
else
if (t2>=0)
return (a&t2);
else
return (a&b);
}
function or(a,b) {
a=integer(a);
b=integer(b);
var t1=(a-0x80000000);
var t2=(b-0x80000000);
if (t1>=0)
if (t2>=0)
return ((t1|t2)+0x80000000);
else
return ((t1|b)+0x80000000);
else
if (t2>=0)
return ((a|t2)+0x80000000);
else
return (a|b);
}
function xor(a,b) {
a=integer(a);
b=integer(b);
var t1=(a-0x80000000);
var t2=(b-0x80000000);
if (t1>=0)
if (t2>=0)
return (t1^t2);
else
return ((t1^b)+0x80000000);
else
if (t2>=0)
return ((a^t2)+0x80000000);
else
return (a^b);
}
function not(a) {
a=integer(a);
return (0xffffffff-a);
}
/* Here begin the real algorithm */
var state = new array(4);
var count = new array(2);
count[0] = 0;
count[1] = 0;
var buffer = new array(64);
var transformBuffer = new array(16);
var digestBits = new array(16);
var S11 = 7;
var S12 = 12;
var S13 = 17;
var S14 = 22;
var S21 = 5;
var S22 = 9;
var S23 = 14;
var S24 = 20;
var S31 = 4;
var S32 = 11;
var S33 = 16;
var S34 = 23;
var S41 = 6;
var S42 = 10;
var S43 = 15;
var S44 = 21;
function F(x,y,z) {
return or(and(x,y),and(not(x),z));
}
function G(x,y,z) {
return or(and(x,z),and(y,not(z)));
}
function H(x,y,z) {
return xor(xor(x,y),z);
}
function I(x,y,z) {
return xor(y ,or(x , not(z)));
}
function rotateLeft(a,n) {
return or(shl(a, n),(shr(a,(32 - n))));
}
function FF(a,b,c,d,x,s,ac) {
a = a+F(b, c, d) + x + ac;
a = rotateLeft(a, s);
a = a+b;
return a;
}
function GG(a,b,c,d,x,s,ac) {
a = a+G(b, c, d) +x + ac;
a = rotateLeft(a, s);
a = a+b;
return a;
}
function HH(a,b,c,d,x,s,ac) {
a = a+H(b, c, d) + x + ac;
a = rotateLeft(a, s);
a = a+b;
return a;
}
function II(a,b,c,d,x,s,ac) {
a = a+I(b, c, d) + x + ac;
a = rotateLeft(a, s);
a = a+b;
return a;
}
function transform(buf,offset) {
var a=0, b=0, c=0, d=0;
var x = transformBuffer;

a = state[0];
b = state[1];
c = state[2];
d = state[3];

for (i = 0; i < 16; i++) {
x[i] = and(buf[i*4+offset],0xff);
for (j = 1; j < 4; j++) {
x[i]+=shl(and(buf[i*4+j+offset] ,0xff), j * 8);
}
}
/* Round 1 */
a = FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
d = FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
c = FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
b = FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
a = FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
d = FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
c = FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
b = FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
a = FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
d = FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
c = FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
b = FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
a = FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
d = FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
c = FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
b = FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
/* Round 2 */
a = GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
d = GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
c = GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
b = GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
a = GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
d = GG ( d, a, b, c, x[10], S22, 0x2441453); /* 22 */
c = GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
b = GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
a = GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
d = GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
c = GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
b = GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
a = GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
d = GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
c = GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
b = GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
/* Round 3 */
a = HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
d = HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
c = HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
b = HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
a = HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
d = HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
c = HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
b = HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
a = HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
d = HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
c = HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
b = HH ( b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
a = HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
d = HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
c = HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
b = HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
/* Round 4 */
a = II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
d = II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
c = II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
b = II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
a = II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
d = II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
c = II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
b = II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
a = II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
d = II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
c = II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
b = II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
a = II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
d = II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
c = II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
b = II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
state[0] +=a;
state[1] +=b;
state[2] +=c;
state[3] +=d;
}
function init() {
count[0]=count[1] = 0;
state[0] = 0x67452301;
state[1] = 0xefcdab89;
state[2] = 0x98badcfe;
state[3] = 0x10325476;
for (i = 0; i < digestBits.length; i++)
digestBits[i] = 0;
}
function update(b) {
var index,i;

index = and(shr(count[0],3) , 0x3f);
if (count[0]<0xffffffff-7)
count[0] += 8;
else {
count[1]++;
count[0]-=0xffffffff+1;
count[0]+=8;
}
buffer[index] = and(b,0xff);
if (index >= 63) {
transform(buffer, 0);
}
}
function finish() {
var bits = new array(8);
varpadding;
vari=0, index=0, padLen=0;
for (i = 0; i < 4; i++) {
bits[i] = and(shr(count[0],(i * 8)), 0xff);
}
for (i = 0; i < 4; i++) {
bits[i+4]=and(shr(count[1],(i * 8)), 0xff);
}
index = and(shr(count[0], 3) ,0x3f);
padLen = (index < 56) ? (56 - index) : (120 - index);
padding = new array(64);
padding[0] = 0x80;
for (i=0;i<padLen;i++)
update(padding[i]);
for (i=0;i<8;i++)
update(bits[i]);
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
digestBits[i*4+j] = and(shr(state[i], (j * 8)) , 0xff);
}
}
}
/* End of the MD5 algorithm */
function hexa(n) {
var hexa_h = "0123456789abcdef";
var hexa_c="";
var hexa_m=n;
for (hexa_i=0;hexa_i<8;hexa_i++) {
hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c;
hexa_m=Math.floor(hexa_m/16);
}
return hexa_c;
}

var ascii="01234567890123456789012345678901" +
" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+
"[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
function MD5(entree)
{
var l,s,k,ka,kb,kc,kd;
init();
for (k=0;k<entree.length;k++) {
l=entree.charAt(k);
update(ascii.lastIndexOf(l));
}
finish();
ka=kb=kc=kd=0;
for (i=0;i<4;i++) ka+=shl(digestBits[15-i], (i*8));
for (i=4;i<8;i++) kb+=shl(digestBits[15-i], ((i-4)*8));
for (i=8;i<12;i++) kc+=shl(digestBits[15-i], ((i-8)*8));
for (i=12;i<16;i++) kd+=shl(digestBits[15-i], ((i-12)*8));
s=hexa(kd)+hexa(kc)+hexa(kb)+hexa(ka);
return s;
}
/* This implement the MD5 test suite */
var testOk=false;
function teste() {
if (testOk) return;
document.test.o1.value=MD5(document.test.i1.value);
document.test.o2.value=MD5(document.test.i2.value);
document.test.o3.value=MD5(document.test.i3.value);
document.test.o4.value=MD5(document.test.i4.value);
document.test.o5.value=MD5(document.test.i5.value);
document.test.o6.value=MD5(document.test.i6.value);
document.test.o7.value=MD5(document.test.i7.value);
testOk=true;
}
// -->
</SCRIPT>
<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<CENTER><!-- <SERVICE NAME="geoguide"> -->
<TABLE bgColor=#666666 border=0 cellPadding=1 cellSpacing=0 width=468>
<TBODY>
<TR>
<TD>
<TABLE bgColor=#eeeeee border=0 cellPadding=2 cellSpacing=0
width="100%"><TBODY>
<TR>
<TD bgColor=#ffffff><A
href="http://geocities.yahoo.com/addons/interact/mbe.html"><IMG
alt="Yahoo! GeoCities Member Banner Exchange" border=0 height=20
src="MD5 Message Digest algorithm in Javascript_files/mbeFFFFFF.gif"
width=335></A></TD>
<TD align=right bgColor=#ffffff><FONT face=Arial size=-1><A
href="http://geocities.yahoo.com/addons/interact/mbe.html">Info</A></FONT> </TD></TR></TBODY></TABLE></TD></TR></TBODY> ;</TABLE>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=468>
<TBODY>
<TR>
<TD height=1 vAlign=top></TD></TR>
<TR>
<TD vAlign=top>
<SCRIPT language=javascript
src="MD5 Message Digest algorithm in Javascript_files/toto.js"></SCRIPT>
</TD></TR></TBODY></TABLE><!-- </SERVICE> --></CENTER><A
href="http://www.geocities.com/SiliconValley/7116/jv_main.html"><IMG
alt="Back to JS main page" height=33
src="MD5 Message Digest algorithm in Javascript_files/java.gif" width=33></A>
<P>BY:<A href="mailto:Henri.Torgemane@etu.utc.fr">Henri Torgemane</A>...<A
href="http://www.undergrad.math.uwaterloo.ca/~htorgema/">Homepage</A><BR>DATE:1996-10-07<BR>
<HR>
<H1>MD5 Message Digest algorithm in Javascript </H1>
<UL>
<LI><A href="http://www.geocities.com/SiliconValley/7116/jv_md5.html#test"
onclick=teste()>MD5 test suite </A>(You must click here to launch the test)
<BR><BR>
<LI><A href="http://www.geocities.com/SiliconValley/7116/jv_md5.html#try">Try
it!</A> <BR><BR></LI></UL>This code was succesfully tested with Netscape 2.0 and
Netscape 3.0b4. <BR>
<HR>
<A name=test>
<H2>MD5 test suite </H2>
<FORM name=test>In:<INPUT name=i1 size=50><BR>Out:<INPUT name=o1
size=35><BR>In:<INPUT name=i2 size=50 value=a><BR>Out:<INPUT name=o2
size=35><BR>In:<INPUT name=i3 size=50 value=abc><BR>Out:<INPUT name=o3
size=35><BR>In:<INPUT name=i4 size=50 value="message digest"><BR>Out:<INPUT
name=o4 size=35><BR>In:<INPUT name=i5 size=50
value=abcdefghijklmnopqrstuvwxyz><BR>Out:<INPUT name=o5 size=35><BR>In:<INPUT
name=i6 size=50
value=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789><BR>Out:<INPUT
name=o6 size=35><BR>In:<INPUT name=i7 size=50
value=12345678901234567890123456789012345678901234567890123456789012345678901234567890><BR>Out:<INPUT
name=o7 size=35><BR><!--
<INPUT type="button" value="Start the Test" OnClick="test()">
--></FORM>
<HR>
</A><A name=try>
<H2>Try it!</H2>
<FORM>Enter your message: <INPUT name=entree size=50> <INPUT onclick=this.form.sortie.value=MD5(this.form.entree.value) type=button value="Click here to run MD5">
<BR><BR>fingerprint: <INPUT name=sortie size=35> </FORM>
<SCRIPT>
<!--
if (location.hash=="#test") teste();
// -->
</SCRIPT>
<HR>
If you want this script just choose "Save Frame As..." (in Netscape) when you
have the focus on the frame.
<P><!--webbot bot="HTMLMarkup" startspan -->
<SCRIPT
src="MD5 Message Digest algorithm in Javascript_files/externalfoot.js"></SCRIPT>
<!--webbot
bot="HTMLMarkup" endspan --></P>
<P><I>URL: http://www.geocities.com/SiliconValley/7116/jv_md5.html</I> <!-- text below generated by server. PLEASE REMOVE --></APPLET></OBJECT></LAYER>
<DIV></DIV></SPAN></STYLE></NOSCRIPT></TABLE></SCRIPT>
<SCRIPT language=JavaScript
src="MD5 Message Digest algorithm in Javascript_files/ygIELib9.js"></SCRIPT>
<SCRIPT
language=JavaScript><script language="JavaScript">yviR='us';yfiEA(1);</SCRIPT>
<SCRIPT language=JavaScript
src="MD5 Message Digest algorithm in Javascript_files/geov2.js"></SCRIPT>
<SCRIPT language=javascript>geovisit();</SCRIPT>
<NOSCRIPT><IMG border=0 height=1
src="MD5 Message Digest algorithm in Javascript_files/visit.gif"
width=1></NOSCRIPT> <IMG alt=1 height=1
src="MD5 Message Digest algorithm in Javascript_files/serv.gif" width=1>
</A></BODY></HTML>
16 years ago
Hai,
sorry for a long reply .. I am just cut pasting a source i had & hope it helps.
<html>
<head>
<title>KeyTrap Key-Detection Test Page</title>
<script language="javascript">
<!-- start hide
// this script block contains code normally found in keytrap.js
function Key(ns4code, ns5code, ns6code,
ie4code, ie5code, ie6code, action, modkeys) {
this.ns4code = ns4code; // ns4 keycode value
this.ns5code = ns5code; // ns5 keycode value
this.ns6code = ns6code; // ns6 keycode value
this.ie4code = ie4code; // ie4 keycode value
this.ie5code = ie5code; // ie5 keycode value
this.ie5code = ie6code; // ie6 keycode value
this.action = eval(action); // method called on detection
// if the optional modkeys argument is not present in the call
// to new Key(), this.modkeys is set to "", meaning that no mod
// keys must be held down for this Key object to be detected
if (arguments.length == 8)
this.modkeys = modkeys;
else
this.modkeys = "";
}
var Keys = new Array(); // store Key objects in Keys[] array
var Count = 0; // index into Keys[]
var Ns4 = false; var Ns5 = false; var Ns6 = false; var Ns4up = false;
var Ie4 = false; var Ie5 = false; var Ie6 = false; var Ie4up = false;
// note the workaround to get Ns6
if (navigator.appName.indexOf("Netscape") != -1) {
if (navigator.userAgent.indexOf("Netscape6") != -1) Ns6 = true;
else if (parseInt(navigator.appVersion) >= 5) Ns5 = true;
else if (parseInt(navigator.appVersion) >= 4) Ns4 = true;
if (Ns4 | | Ns5 | | Ns6) Ns4up = true;
}
// and the workarounds to get Ie5 and Ie6
else if (navigator.appName.indexOf("Explorer") != -1) {
if (navigator.userAgent.indexOf("MSIE 6") != -1) Ie6 = true;
if (navigator.userAgent.indexOf("MSIE 5") != -1) Ie5 = true;
else if (parseInt(navigator.appVersion) >= 4) Ie4 = true;
if (Ie4 | | Ie5 | | Ie6) Ie4up = true;
}
// modifier-key processing globals
var Shift = false, Ctrl = false, Alt = false;
var SHIFT_KEYCODE = 16, CTRL_KEYCODE = 17, ALT_KEYCODE = 18;
function keyDown(evt) {
// begin by getting the keycode of the depressed key and all
// currently depressed modifier keys (Shift, Ctrl, Alt)
var keycode;
if (Ns4up) {
keycode = evt.which;
// Netscape Shift/Ctrl/Alt processing only in 5+ browsers
if (keycode == SHIFT_KEYCODE && (Ns5 | | Ns6)) Shift = true;
if (keycode == CTRL_KEYCODE && (Ns5 | | Ns6)) Ctrl = true;
if (keycode == ALT_KEYCODE && (Ns5 | | Ns6)) Alt = true;
}
else if (Ie4up) {
keycode = event.keyCode;
Shift = event.shiftKey;
Ctrl = event.ctrlKey;
Alt = event.altKey;
}
// execute the action associated with keycode and all the
// currently depressed modified keys (Shift, Ctrl, Alt)
for (var i=0; i<Keys.length; i++) {
if ((Ns4 && (keycode == Keys[i].ns4code)) | |
(Ns5 && (keycode == Keys[i].ns5code)) | |
(Ns6 && (keycode == Keys[i].ns6code)) | |
(Ie4 && (keycode == Keys[i].ie4code)) | |
(Ie5 && (keycode == Keys[i].ie5code)) | |
(Ie6 && (keycode == Keys[i].ie6code))) {
if ((Shift && (Keys[i].modkeys.toLowerCase().indexOf("shift") != -1) | |
!Shift && (Keys[i].modkeys.toLowerCase().indexOf("shift") == -1)) &&
(Ctrl && (Keys[i].modkeys.toLowerCase().indexOf("ctrl") != -1) | |
!Ctrl && (Keys[i].modkeys.toLowerCase().indexOf("ctrl") == -1)) &&
(Alt && (Keys[i].modkeys.toLowerCase().indexOf("alt") != -1) | |
!Alt && (Keys[i].modkeys.toLowerCase().indexOf("alt") == -1))) {
Keys[i].action();
return;
}
}
}
}
document.onkeydown = keyDown;
if (Ns4up) document.captureEvents(Event.KEYDOWN);
// end hide -->
</script>
<script language="javascript">
<!-- start hide
// display detected key in keynameText text box
function show(str) {
document.forms[0].keynameText.value = str;
window.focus();
}
/* control keys ***************************************** */
// Backspace key
Keys[Count++] = new Key(8, 8, 8, 8, 8, 8, "bs");
function bs() { show("backspace"); }
// Tab key
Keys[Count++] = new Key(-1, 9, 9, 9, 9, 9, "tab");
function tab() { show("tab"); }
// Enter key
Keys[Count++] = new Key(13, 13, 13, 13, 13, 13, "enter");
function enter() { show("enter"); }
// Esc key
Keys[Count++] = new Key(-1, 27, 27, 27, 27, 27, "esc");
function esc() { show("esc"); }
// Spacebar key
Keys[Count++] = new Key(32, 32, 32, 32, 32, 32, "sb");
function sb() { show("spacebar"); }
// Left Arrow key
Keys[Count++] = new Key(-1, 37, 37, 37, 37, 37, "la");
function la() { show("left arrow"); }
// Up Arrow key
Keys[Count++] = new Key(1, 38, 38, 38, 38, 38, "ua");
function ua() { show("up arrow"); }
// Right Arrow key
Keys[Count++] = new Key(-1, 39, 39, 39, 39, 39, "ra");
function ra() { show("right arrow"); }
// Down Arrow key
Keys[Count++] = new Key(-1, 40, 40, 40, 40, 40, "da");
function da() { show("down arrow"); }

/* function keys **************************************** */
// F1 key
Keys[Count++] = new Key(-1, 112, 112, 112, 112, 112, "f1");
function f1() { show("f1"); }
// F2 key
Keys[Count++] = new Key(-1, 113, 113, 113, 113, 113, "f2");
function f2() { show("f2"); }
// F3 key
Keys[Count++] = new Key(-1, 114, 114, 114, 114, 114, "f3");
function f3() { show("f3"); }
// F4 key
Keys[Count++] = new Key(-1, 115, 115, 115, 115, 115, "f4");
function f4() { show("f4"); }
// F5 key
Keys[Count++] = new Key(-1, 116, 116, 116, 116, 116, "f5");
function f5() { show("f5"); }
// F6 key
Keys[Count++] = new Key(-1, 117, 117, 117, 117, 117, "f6");
function f6() { show("f6"); }
// F7 key
Keys[Count++] = new Key(-1, 118, 118, 118, 118, 118, "f7");
function f7() { show("f7"); }
// F8 key
Keys[Count++] = new Key(-1, 119, 119, 119, 119, 119, "f8");
function f8() { show("f8"); }
// F9 key
Keys[Count++] = new Key(-1, 120, 120, 120, 120, 120, "f9");
function f9() { show("f9"); }
// F10 key
Keys[Count++] = new Key(-1, 121, 121, 121, 121, 121, "f10");
function f10() { show("f10"); }
// F11 key
Keys[Count++] = new Key(-1, 122, 122, 122, 122, 122, "f11");
function f11() { show("f11"); }
// F12 key
Keys[Count++] = new Key(-1, 123, 123, 123, 123, 123, "f12");
function f12() { show("f12"); }
/* letter keys ****************************************** */
// A key
Keys[Count++] = new Key(97, 65, 65, 65, 65, 65, "a");
function a() { show("a"); }
// B key
Keys[Count++] = new Key(98, 66, 66, 66, 66, 66, "b");
function b() { show("b"); }
// C key
Keys[Count++] = new Key(99, 67, 67, 67, 67, 67, "c");
function c() { show("c"); }
// D key
Keys[Count++] = new Key(100, 68, 68, 68, 68, 68, "d");
function d() { show("d"); }
// E key
Keys[Count++] = new Key(101, 69, 69, 69, 69, 69, "e");
function e() { show("e"); }
// F key
Keys[Count++] = new Key(102, 70, 70, 70, 70, 70, "f");
function f() { show("f"); }
// G key
Keys[Count++] = new Key(103, 71, 71, 71, 71, 71, "g");
function g() { show("g"); }
// H key
Keys[Count++] = new Key(104, 72, 72, 72, 72, 72, "h");
function h() { show("h"); }
// I key
Keys[Count++] = new Key(105, 73, 73, 73, 73, 73, "i");
function i() { show("i"); }
// J key
Keys[Count++] = new Key(106, 74, 74, 74, 74, 74, "j");
function j() { show("j"); }
// K key
Keys[Count++] = new Key(107, 75, 75, 75, 75, 75, "k");
function k() { show("k"); }
// L key
Keys[Count++] = new Key(108, 76, 76, 76, 76, 76, "l");
function l() { show("l"); }
// M key
Keys[Count++] = new Key(109, 77, 77, 77, 77, 77, "m");
function m() { show("m"); }
// N key
Keys[Count++] = new Key(110, 78, 78, 78, 78, 78, "n");
function n() { show("n"); }
// O key
Keys[Count++] = new Key(111, 79, 79, 79, 79, 79, "o");
function o() { show("o"); }
// P key
Keys[Count++] = new Key(113, 80, 80, 80, 80, 80, "p");
function p() { show("p"); }
// Q key
Keys[Count++] = new Key(113, 81, 81, 81, 81, 81, "q");
function q() { show("q"); }
// R key
Keys[Count++] = new Key(114, 82, 82, 82, 82, 82, "r");
function r() { show("r"); }
// S key
Keys[Count++] = new Key(115, 83, 83, 83, 83, 83, "s");
function s() { show("s"); }
// T key
Keys[Count++] = new Key(116, 84, 84, 84, 84, 84, "t");
function t() { show("t"); }
// U key
Keys[Count++] = new Key(117, 85, 85, 85, 85, 85, "u");
function u() { show("u"); }
// V key
Keys[Count++] = new Key(118, 86, 86, 86, 86, 86, "v");
function v() { show("v"); }
// W key
Keys[Count++] = new Key(119, 87, 87, 87, 87, 87, "w");
function w() { show("w"); }
// X key
Keys[Count++] = new Key(120, 88, 88, 88, 88, 88, "x");
function x() { show("x"); }
// Y key
Keys[Count++] = new Key(121, 89, 89, 89, 89, 89, "y");
function y() { show("y"); }
// Z key
Keys[Count++] = new Key(122, 90, 90, 90, 90, 90, "z");
function z() { show("z"); }

/* number keys ****************************************** */
// 0 key
Keys[Count++] = new Key(48, 48, 48, 48, 48, 48, "_0");
function _0() { show("0"); }
// 1 key
Keys[Count++] = new Key(49, 49, 49, 49, 49, 49, "_1");
function _1() { show("1"); }
// 2 key
Keys[Count++] = new Key(50, 50, 50, 50, 50, 50, "_2");
function _2() { show("2"); }
// 3 key
Keys[Count++] = new Key(51, 51, 51, 51, 51, 51, "_3");
function _3() { show("3"); }
// 4 key
Keys[Count++] = new Key(52, 52, 52, 52, 52, 52, "_4");
function _4() { show("4"); }
// 5 key
Keys[Count++] = new Key(53, 53, 53, 53, 53, 53, "_5");
function _5() { show("5"); }
// 6 key
Keys[Count++] = new Key(54, 54, 54, 54, 54, 54, "_6");
function _6() { show("6"); }
// 7 key
Keys[Count++] = new Key(55, 55, 55, 55, 55, 55, "_7");
function _7() { show("7"); }
// 8 key
Keys[Count++] = new Key(56, 56, 56, 56, 56, 56, "_8");
function _8() { show("8"); }
// 9 key
Keys[Count++] = new Key(57, 57, 57, 57, 57, 57, "_9");
function _9() { show("9"); }
/* punctuation keys ************************************* */
// ` key
Keys[Count++] = new Key(96, 192, 192, 192, 192, 192, "backap");
function backap() { show("`"); }
// - key
Keys[Count++] = new Key(45, 109, 109, 189, 189, 189,"dash");
function dash() { show("-"); }
// = key
Keys[Count++] = new Key(61, 61, 61, 187, 187, 187, "equals");
function equals() { show("="); }
// \ key
Keys[Count++] = new Key(92, 220, 220, 220, 220, 220, "backslash");
function backslash() { show("\\"); }
// [ key
Keys[Count++] = new Key(91, 219, 219, 219, 219, 219, "leftbr");
function leftbr() { show("["); }
// ] key
Keys[Count++] = new Key(93, 221, 221, 221, 221, 221, "rightbr");
function rightbr() { show("]"); }
// ; key
Keys[Count++] = new Key(59, 59, 59, 186, 186, 186, "semicolon");
function semicolon() { show(";"); }
// ' key
Keys[Count++] = new Key(39, 222, 222, 222, 222, 222, "ap");
function ap() { show("'"); }
// , key
Keys[Count++] = new Key(44, 188, 188, 188, 188, 188, "comma");
function comma() { show(","); }
// . key
Keys[Count++] = new Key(46, 190, 190, 190, 190, 190, "period");
function period() { show("."); }
// / key
Keys[Count++] = new Key(47, 191, 191, 191, 191, 191, "forwardslash");
function forwardslash() { show("/"); }
/* combination keys ************************************* */
// Shift+Enter key
Keys[Count++] = new Key(13, 13, 13, 13, 13, 13, "shenter", "shift");
function shenter() { show("shift+enter"); }
// Ctrl+Enter key
Keys[Count++] = new Key(13, 13, 13, 13, 13, 13, "ctenter", "ctrl");
function ctenter() { show("ctrl+enter"); }
// Alt+Enter key
Keys[Count++] = new Key(13, 13, 13, 13, 13, 13, "alenter", "alt");
function alenter() { show("alt+enter"); }
// Shift+Ctrl+Enter key
Keys[Count++] = new Key(13, 13, 13, 13, 13, 13, "shctenter", "shift+ctrl");
function shctenter() { show("shift+ctrl+enter"); }
// Ctrl+Alt+Enter key
Keys[Count++] = new Key(13, 13, 13, 13, 13, 13, "ctalenter", "ctrl+alt");
function ctalenter() { show("ctrl+alt+enter"); }
// Shift+Ctrl+Alt+Enter key
Keys[Count++] = new Key(13, 13, 13, 13, 13, 13, "shctalenter", "shift+ctrl+alt");
function shctalenter() { show("shift+ctrl+alt+enter"); }
// Shift+g key
Keys[Count++] = new Key(71, 71, 71, 71, 71, 71, "shg", "shift");
function shg() { show("shift+g"); }
// Ctrl+g key
Keys[Count++] = new Key(71, 71, 71, 71, 71, 71, "ctg", "ctrl");
function ctg() { show("ctrl+g"); }
// Alt+g key
Keys[Count++] = new Key(71, 71, 71, 71, 71, 71, "alg", "alt");
function alg() { show("alt+g"); }
// Shift+Ctrl+g key
Keys[Count++] = new Key(71, 71, 71, 71, 71, 71, "shctg", "shift+ctrl");
function shctg() { show("shift+ctrl+g"); }
// Ctrl+Alt+g key
Keys[Count++] = new Key(71, 71, 71, 71, 71, 71, "ctalg", "ctrl+alt");
function ctalg() { show("ctrl+alt+g"); }
// Shift+Ctrl+Alt+g key
Keys[Count++] = new Key(71, 71, 71, 71, 71, 71, "shctalg", "shift+ctrl+alt");
function shctalg() { show("shift+ctrl+alt+g"); }
// Shift+UpArrow key
Keys[Count++] = new Key(38, 38, 38, 38, 38, 38, "shup", "shift");
function shup() { show("shift+up arrow"); }
// Ctrl+UpArrow key
Keys[Count++] = new Key(38, 38, 38, 38, 38, 38, "ctup", "ctrl");
function ctup() { show("ctrl+up arrow"); }
// Alt+UpArrow key
Keys[Count++] = new Key(38, 38, 38, 38, 38, 38, "alup", "alt");
function alup() { show("alt+up arrow"); }
// Shift+Ctrl+UpArrow key
Keys[Count++] = new Key(38, 38, 38, 38, 38, 38, "shctup", "shift+ctrl");
function shctup() { show("shift+ctrl+up arrow"); }
// Ctrl+Alt+UpArrow key
Keys[Count++] = new Key(38, 38, 38, 38, 38, 38, "ctalup", "ctrl+alt");
function ctalup() { show("ctrl+alt+up arrow"); }
// Shift+Ctrl+Alt+UpArrow key
Keys[Count++] = new Key(38, 38, 38, 38, 38, 38, "shctalup", "shift+ctrl+alt");
function shctalup() { show("shift+ctrl+alt+up arrow"); }
// Shift+F2 key
Keys[Count++] = new Key(113, 113, 113, 113, 113, 113, "shf2", "shift");
function shf2() { show("shift+f2"); }
// Ctrl+F2 key
Keys[Count++] = new Key(113, 113, 113, 113, 113, 113, "ctf2", "ctrl");
function ctf2() { show("ctrl+f2"); }
// Alt+F2 key
Keys[Count++] = new Key(113, 113, 113, 113, 113, 113, "alf2", "alt");
function alf2() { show("alt+f2"); }
// Shift+Ctrl+F2 key
Keys[Count++] = new Key(113, 113, 113, 113, 113, 113, "shctf2", "shift+ctrl");
function shctf2() { show("shift+ctrl+f2"); }
// Ctrl+Alt+F2 key
Keys[Count++] = new Key(113, 113, 113, 113, 113, 113, "ctalf2", "ctrl+alt");
function ctalf2() { show("ctrl+alt+f2"); }
// Shift+Ctrl+Alt+F2 key
Keys[Count++] = new Key(113, 113, 113, 113, 113, 113, "shctalf2", "shift+ctrl+alt");
function shctalf2() { show("shift+ctrl+alt+f2"); }
// end hide -->
</script>
</head>

<body>
<H1>KeyTrap Key-Detection Test Page</H1>
Thank you for testing KeyTrap. :-) Your results will help make KeyTrap.js a truly "browser-universal" key-detection library. Please post your results to the <a href="http://f5.dejanews.com/frameset/frameset.cgi?channel=devhead&forum=scripthead">ScriptHead Forum.</a><p>
<form>
You pressed: <input type="text" name="keynameText" onFocus="this.blur()"><p>
1. In Netscape 4+ or MSIE 4+, press each of the following keys. Except where noted, the pressed key's identity should be displayed in the above text box. If not, please let me know.<p>
<table border="2" cellspacing="0" cellpadding="4" bgcolor="#99CCFF">
<tr>
<td>
<p>Note: In some cases, your browser and/or operating system might trap a key (in step 1) or a key combination (in step 2) *before* KeyTrap gets around to it. If this happens, please include it in your results.</p>
</td>
</tr>
</table><p>
<ul>
<li>All alphanumeric/punctuation keys, but *not* in combination with Shift, Ctrl, or Alt (and their Mac equivalents)<br>
<li>Esc (won't work in NS4), Tab (ditto), Backspace, Spacebar, and Enter<br>
<li>All twelve function keys (won't work in NS4)<br>
<li>The four arrow keys (won't work in NS4)
</ul><p>
2. Press each of the following key combinations (alas, these will not work in NS4, because NS4 does not support Shift/Ctrl/Alt+key detection). Again, please let me know if any of these combos' identities is not displayed in the text box.<p>
<ul>
<li>Shift+Enter, Ctrl+Enter, Alt+Enter, Shift+Ctrl+Enter, Ctrl+Alt+Enter, Shift+Ctrl+Alt+Enter<br>
<li>Shift+g, Ctrl+g, Alt+g, Shift+Ctrl+g, Ctrl+Alt+g, Shift+Ctrl+Alt+g<br>
<li>Shift+UpArrow, Ctrl+UpArrow, Alt+UpArrow, Shift+Ctrl+UpArrow, Ctrl+Alt+UpArrow, Shift+Ctrl+Alt+UpArrow<br>
<li>Shift+F2, Ctrl+F2, Alt+F2, Shift+Ctrl+F2, Ctrl+Alt+F2, Shift+Ctrl+Alt+F2<br>
</ul>
</FORM>
</body>
</html>
Regards,
srini
Hi ,
When i have a list box and menu in same space, always the list box is dispayed at front. from net i have learned that using css-p it can be solved.Can i have a sample using css-p. Does any of teh editors do this functionality.
Also i would like to know a work around which can work in netscape too..
regards,
srini
Hai ,
This part of code ( refered as 1) is for reading a content of site using the URL class in java
( code 1)
String temp=new String("");
URL wsurl = new URL("www.microsoft.com");
BufferedReader wsBuf = new BufferedReader(new InputStreamReader(wsurl.openStream()));
int wcIntval = wsBuf.read();

This part of code compares teh content with HTTP .. in ur case u should check for the html tags& < >.(code 2)

if ( (wcChar == 'H') | | (wcChar == 'h' ) )
{
wcChar=(char)wsBuf.read();
if ( (wcChar == 't') | | (wcChar == 'T' ) )
{
wcChar=(char)wsBuf.read();
if ( (wcChar == 't') | | (wcChar == 'T' ) )
{
wcChar=(char)wsBuf.read();
if ( (wcChar == 'P') | | (wcChar == 'p' ) )
{
wcChar=(char)wsBuf.read();
resurl="http";

If so , then replace the strring with the codes.
Hope it helps.
regards,
srini
Hai ,
I guess You have are talkign abt expiring a cache . Do u want from client side the Page has to expire after a page. Then Pragma cache=nocahe tag will help u .
regards,
srini
Hai ,
By using the URL class you can read the HTML file in to strign array . There by using indexOf you can find out < & > and remove all the strign inbetween . I have almost simillar prgm... Please mail me if u want.
regards,
srini
Hai ,
May i know how can we fix teh problem of having teh higher z-axis of the list box in netscape.MR.Mathias P.W Nilsson, can u please say teh work around. If it is css-p , please do let me know how ?
regards,
srini
hai,
IE will not help in the case. one easier idea is to go for netscape :-)
regards,
srini