1

I've got a package login that has a few classes inside of it...I thought my code would look like this:

importPackage(login);
var password = document.form1.pword.value;
var hash = JPP7.toHash(password);

where JPP7 is the class of mine that does the hashing? I am using a colleagues javascript code, but I know next to nothing about javascript. Am I going to have to give an absolute path to the package folder?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
SetSlapShot
  • 1,298
  • 1
  • 21
  • 48

1 Answers1

4

(Converted from my comment above)

You cannot (at least not easily nor out-of-the-box) use Java code in Javascript. Despite the similarity in their names, they are very different and are incompatible with each other. See also What's the difference between Javascript and Java?.

There was once an implementation of the JVM in Javascript, but it seems to now be dead. I wouldn't have recommended using it in any sort of production code anyway.

Community
  • 1
  • 1
Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214