aspose file tools*
The moose likes Applets and the fly likes Object doesn't support this method or property-Error calling applets from javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Object doesn Watch "Object doesn New topic
Author

Object doesn't support this method or property-Error calling applets from javascript

chandru ram
Greenhorn

Joined: Jul 03, 2002
Posts: 18
Hi,
Im trying to call a method on the swing component from javascript. but the browser gives an javascript error dialog box as "Object doesn't support this method or property". pls help. iam attaching the code of both html and the applet.

applet
------

import javax.swing.JLabel;

public class TestApplet
extends javax.swing.JApplet
{

public void init()
{
this.getContentPane().add(new JLabel("Harsh"));
}

public void callMe()
{
java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
public Object run() {
// do priv stuff here.
System.out.println("Applet Method called");
return null; // return whatever you want.
}
});
}
}



HTML
-----

<html>
<body onnload="callAppletMethod();">
<script>

function callAppletMethod()
{
alert("Inside function");
alert("document is"+document);
alert("document all is"+document.all);
alert("testApplet is"+document.TestApplet);
alert("testApplet callMe is"+document.TestApplet.callMe());
document.TestApplet.callMe();

}

</script>



<OBJECT

classid= "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"

codebase= "http://java.sun.com/update/1.4.2/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"
WIDTH="775" HEIGHT="400" NAME="TestApplet">

<PARAM NAME = CODE VALUE = "TestApplet.class" >
<PARAM NAME = "type" VALUE = "application/x-java-applet;jpi-version=1.4.1">
<PARAM NAME = "scriptable" VALUE = "true">
<PARAM NAME = "mayscript" VALUE="true">

<COMMENT>
<EMBED
type = "application/x-java-applet;jpi-version=1.4.1"
CODE = TestApplet
scriptable = false
pluginspage = "http://java.sun.com/products/plugin/index.html#download">
<NOEMBED>
</TaskModel>'>
</NOEMBED>
</EMBED>
</COMMENT>
</OBJECT>

</body>
</html>

Im using IE 6.0. the jdk version im using is 1.4.0
The strange thing is the same code works on some different machines. but im not able to trace what is the difference.

pls help

thanks in advance
chandru ram
Im using IE 6.0. the jdk version im using is 1.4.0
The strange thing is the same code works on some different machines. but im not able to trace what is the difference.

pls help

thanks in advance
chandru ram
Im using IE 6.0. the jdk version im using is 1.4.0
The strange thing is the same code works on some different machines. but im not able to trace what is the difference.

pls help

thanks in advance
chandru ram
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object doesn't support this method or property-Error calling applets from javascript
 
Similar Threads
Unable to load Applet in Tomcat 5.5.12
JDK 1.5 Compiled Applet not working with JRE 1.4
Unable to load Applet in Tomcat 5.5.12
Installing IE7 broke my applet
Reg: Running Swing in Browser