Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Passing Parameters from Java to JavaScript

Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I'm trying to pass parameters from java to java script.
I'm getting an error " JavaScript error :type 'javascript' into location for details " in the bottom of my screen of my browser(Netscape).
What about setting the class path???
Thanks all for your time.
Here is the codes:
import java.awt.*;
import java.applet.*;
import netscape.javascript.JSObject;
import java.lang.*;

public class array extends java.applet.Applet
public void init()
// Take out this line if you don't use or symantec.itools.awt.util.StatusScroller

// This code is automatically generated by Visual Cafe when you add
// components to the visual environment. It instantiates and initializes
// the components. To modify the code, only use code syntax that matches
// what Visual Cafe can generate, or Visual Cafe may be unable to back
// parse your Java file into its visual environment.

win= JSObject.getWindow(this);
catch(Exception e){}


String testStr;
Integer testInt;
Character testChar;
JSObject win;
Object testArray[]=new Object[3];
void create()

testStr=new String("Test string");
testInt=new Integer(1);
testChar=new Character('a');

catch(Exception e){}
public void paint(Graphics g)
g.drawString("here is an applet ",50,25);

Here is the HTML file
function extractArray(var1,var2,var3)
alert ("java return string: " + var1);
alert ("java return int : " + var2);
alert ("java return char : " + var3);
<input type=button value=click onClick=document.array.create()>

<APPLET name = array code=JSObject.class MAYSCRIPT >

Arch enemy? I mean, I don't like you, but I don't think you qualify as "arch enemy". Here, try this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic