Click to See Complete Forum and Search --> : Calling applet methods (again).


Rype69
01-05-2003, 04:21 PM
My code wont work, can anyone please tell me why...

HTML...

<APPLET CODE=InfoDisplay.class NAME="InfoDisplay" WIDTH=500 HEIGHT=100>
</APPLET>

JavaScript...

var result = false;
var stringUserLevel = "0";
var client = navigator.appName;
var clientVersion = navigator.appVersion;
var platform = navigator.platform;
var stringUserLevel = navigator.appVersion;
result = document.InfoDisplay.displayDetails(client, clientVersion, platform, stringUserLevel);

Java...

public void displayDetails(String clientIn, String clientVersionIn, String platformIn, String stringUserLevelIn)
{
// commands etc...
}

Please help,

Rype69, UK.

khalidali63
01-05-2003, 11:03 PM
your problem is right here

result = document.InfoDisplay.displayDetails(client, clientVersion, platform, stringUserLevel);


you are passing those parameters to the function and you are expecting a return value

public void displayDetails(String clientIn, String clientVersionIn, String platformIn, String stringUserLevelIn)
{
// commands etc...
}


in the java method your return type is void....now how do you expect to get a return type

by the looks of it your logical return type is boolean (true or false

change the java methods void to boolean and return a bollean value in the method.

Khalid

Rype69
01-06-2003, 05:14 AM
error message in ie saying "Object doesn't support this property or method".

I have changed the JavaScript so that the line is: document.InfoDisplay.displayDetails(client, clientVersion, platform, stringUserLevel);

rather than
result = document.InfoDisplay.displayDetails(client, clientVersion, platform, stringUserLevel);

Is it because I'm using ie?