473,473 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Accessing Java Applet from JavaScript under XHTML

Greetings!

I'm trying to control Java Applets using JavaScript. However, the
standard recipes don't work under XHTML (they work well within HTML).
See, for instance, the code

http://www.professores.uff.br/hjbort...-test-01.xhtml

produces the following error message under Firefox 3.0:

document.jsap has no properties
[Break on this error]
document.jsap.setText(document.forms[0].txt1.value);

The same code within HTML works well:

http://www.professores.uff.br/hjbort...n-test-01.html

Is it really possible to control Java Applets using JavaScript under
XHTML?

Any hints are welcome!

Thanks in advance, Humberto.

Sep 12 '08 #1
2 1892
hu*****************@gmail.com writes:
Greetings!

I'm trying to control Java Applets using JavaScript. However, the
standard recipes don't work under XHTML (they work well within HTML).
See, for instance, the code

http://www.professores.uff.br/hjbort...-test-01.xhtml

produces the following error message under Firefox 3.0:

document.jsap has no properties
[Break on this error]
document.jsap.setText(document.forms[0].txt1.value);

The same code within HTML works well:

http://www.professores.uff.br/hjbort...n-test-01.html
My first guess would be that FF doesn't create a document.jsapp
"shortcut" under XML mode. I'm a but surprised it works at all in HTML,
but then I haven't done anything with java applets in years.

Try document.getElementById("jsap").setText(....)

/Not tested since I don't have a java plugin on this machine/

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Sep 12 '08 #2
hu*****************@gmail.com wrote:
http://www.professores.uff.br/hjbort...-test-01.xhtml

produces the following error message under Firefox 3.0:

document.jsap has no properties
[Break on this error]
document.jsap.setText(document.forms[0].txt1.value);
Use
document.applets.jsap.setText(document.forms[0].txt1.value);

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 13 '08 #3

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

Similar topics

0
by: Kookymon1 | last post by:
This is an attempt to respond to an older question (several months). Date: 2002-03-07 13:10:23 PST Subject: On the Common DOM API and Applets. The original message was: >LiveConnect and the...
0
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 ...
3
by: Daniel Pope | last post by:
Hello Everybody, I'm preparing for doing a daunting task: to access Out look Microsoft Outlook Express(regardles the operating system and Outlook version) from a Java applet (after the client...
18
by: Mickey Segal | last post by:
On comp.lang.java.programmer we are discussing problems created for Java programs by pop-up blockers (in the thread "showDocument blocked by new microsoft pop-up blocker"). Our problem is that...
2
by: annie | last post by:
Hi all. Can Java classes/objects be used from within the javascript code on the HTML page? I.e., can I call a Java method from the javascript function? Thanks in advance Anna
4
by: aotemp | last post by:
Does anyone know how to detect the version of Java installed? My website has an application that requires java 1.5+ to be installed, basically if the user doesn;t already have it installed I...
2
by: makthar | last post by:
hi i have the following java applet progam and the javascript the problem is that when the javascript tries to access the applet method it gives me an error as follows document.form1.myApplet is...
3
by: Sanjay | last post by:
Hi Everyone, I am converting an image file into a Java string (via an applet) and would like to pass the Java string back to the Javascript function that calls the applet's. I know the simple...
0
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,...
0
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...
0
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...
0
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.