473,625 Members | 3,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Firefox not calling an applet method

Hi,
I have a .jsp file in the following format:

.... html headers, jsp code, html code...

<jsp:plugin
type="applet"
code="path.in.p acket.appletcla ssname.class"
codebase=".."
jreversion="1.5 "
archive="packet name.jar"
height="0"
width="0"
name="appletnam e"

<jsp:fallback >
<p>Unable to start the applet.</p>
</jsp:fallback>
</jsp:plugin>

.... html code...

<script type="text/javascript">
var theApplet = document.applet s.appletname;
methodOutput = theApplet.callm ethod();
document.write( methodOutput);
</script>

.... the rest of the html code ...

Javascript can call this method with IE 6.0, but with Firefox I get the
following message: "Error: theApplet has no properties".

And here is how Firefox and IE6.0 translate my <jsp:plugin> tag:

<OBJECT classid="clsid: 8AD9C840-044E-11D1-B3E9-00805F499D93"
name="appletnam e"
width="0" height="0"
codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version =1,2,2,0">;
<PARAM name="java_code " value="path.in. packet.appletcl assname.class">
<PARAM name="java_code base" value="..">
<PARAM name="java_arch ive" value="packetna me.jar">
<PARAM name="type" value="applicat ion/x-java-applet;version= 1.5">

<COMMENT>
<EMBED type="applicati on/x-java-applet;version= 1.5" name="appletnam e"
width="0"
height="0" pluginspage="ht tp://java.sun.com/products/plugin/";
java_code="path .in.packet.appl etclassname.cla ss"
java_codebase=" .."
java_archive="p acketname.jar"
clientLocale="e n_IE">
<NOEMBED>
</COMMENT>

<p>Unable to start the applet.</p>

</NOEMBED></EMBED>
</OBJECT>

I have already tried other solutions, like
document.getEle mentsByName() and
document.embeds ( as well as document.getEle mentsByID, but this could
never work with Firefox as, from what I found in google, Firefox does
not assume that applet name = applet id, what IE does).
Still, I never managed to call this method with Firefox.
Would anyone have any other ideas?

Thank you,

Blondie

Sep 26 '05 #1
2 9516


Blondie21 wrote:

<script type="text/javascript">
var theApplet = document.applet s.appletname;
methodOutput = theApplet.callm ethod();
document.write( methodOutput);
To access an object like an applet in the DOM and be able to call its
methods the object needs to be loaded and intialized so your chance to
script an applet by putting the above code simply somewhere in the body
of the HTML document are very low as it is executed while the document
is loaded.
Put the applet in the HTML document and then use script in the onload
handler to try to script the applet. Of course that script can't do
document.write then but I guess that attempt above is only some poor
attempt at debugging.
Or place a button in the HTML document which in its onclick handler
tries to script the applet.

And here is how Firefox and IE6.0 translate my <jsp:plugin> tag:

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


The browser does not translate any <jsp> tags at all, your server side
framework does that and then delivers HTML or HTML tag soup to the browser.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 26 '05 #2
Martin Honnen wrote:

To access an object like an applet in the DOM and be able to call its
methods the object needs to be loaded and intialized so your chance to
script an applet by putting the above code simply somewhere in the body
of the HTML document are very low as it is executed while the document
is loaded.
Put the applet in the HTML document and then use script in the onload
handler to try to script the applet. Of course that script can't do
document.write then but I guess that attempt above is only some poor
attempt at debugging.
Or place a button in the HTML document which in its onclick handler
tries to script the applet.


Thank you for your answer.
No, I'm not using this for debugging.
I still don't understand why this works fine with IE. And what does DOM
have to do with it at all?

Thank you,
Blondie21

Sep 27 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
9869
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ********************************** package Celcom.Client;
2
6905
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on a type mismatch. It is positively because of the boolean(java primitive)parameter. It goes fine if I change this parameter to int or String. This inteface has a lot more methods which works fine, it is just the
2
1882
by: SPG | last post by:
Hi, I have a requirement to call a method on a page from an applet that is not the page that owns the applet.. For example. Page A has the applet. It opens page B.
0
1579
by: autogoor | last post by:
I want to put a java Applet in a jsp page. Here is what I used: <jsp:plugin type="applet" code="mypackage.myApplet" width="450" height="350" > <jsp:params>...</jsp:params>
2
9747
by: Neil Cherry | last post by:
I've done a fair amount of searching on this subject and I can call my Java methods with Javascript if I use the <applet></applet> tags but when I switch over to <object></object> tags I'm not longer able to call my Java method, instead I get: Error: document.CameraViewer.setInterval is not a function How does one use the object tags and call Java methods? --
0
5658
by: ankur | last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER MY HttpChatApplet sccessfully Loaded from ChatDispatch but running on some another PC HttpChatApplet not loaded my Coad ChatDispatch.java
1
1769
by: tarepanda | last post by:
Hi, I'm really clueless on where my code goes wrong in Firefox. Mine is version 2.0.0.6. I have a signed applet that allows for recording, playing back and saving of audio files. The interface which contains record, stop, play and save buttons is done in Flash. So I use javascript for applet-Flash communication. Since I have no control over users' policy files, I wrapped scripts that require special permission in doPrivileged method....
1
2377
by: sheephead86 | last post by:
Hi, I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing in the right direction. Ok the problem. I am creating a program that ask the user to input a height value, the program will then do a calculation and create a golden ratio width. The type of both the height and the width are double. This is...
0
8259
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8192
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8696
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7188
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6119
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.