Web Analytics Made Easy -
StatCounter java in javascript - CodingForum

Announcement

Collapse
No announcement yet.

java in javascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • java in javascript

    Just noticed that you can use all(?...security) classes from the java api. Anyone heard of this before?

    example

    Code:
    <script>
    
    var s = new java.lang.String("test");
    var t = new java.lang.String("test");
    
    alert(s.equals(t));
    
    var astring = "123 test test123";
    var st = new java.util.StringTokenizer(astring);
    while(st.hasMoreTokens()) alert(st.nextToken());
    
    new java.awt.Frame("TEST").show();
    
    // not working /*
    var input = new java.io.BufferedReader(new java.io.FileReader("test.txt"));
    var res = input.readLine(); 
    alert(res); */
    
    </script>
    Last edited by JPM; Jul 29, 2005, 06:37 PM.
    <JPM />

  • #2
    That's been in there for a LONG time (I saw it around '96) but it's almost never used. You can't depend on it because the browser may not have a JVM. Even if it does have a JVM it may be ancient.
    ScriptingMagic.com

    Comment

    Working...
    X