473,598 Members | 3,266 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.applet s & object

I've seen references to using <applets ... > and document.applet s to
access public Java functions from Javascript. Do I still use
document.applet s with <object ...>?

BTW, the FAQS page seems to be broken.

--
Linux Home Automation Neil Cherry nc*****@comcast .net
http://home.comcast.net/~ncherry/ (Text only)
http://hcs.sourceforge.net/ (HCS II)
http://linuxha.blogspot.com/ My HA Blog
Jul 23 '05 #1
4 3285


Neil Cherry wrote:
I've seen references to using <applets ... > and document.applet s to
access public Java functions from Javascript. Do I still use
document.applet s with <object ...>?


Good question but hard to answer, I think that will depend on the
browser and even with a particular browser I am not sure that it could
not depend on the way you use object, whether you use
<object type="applicati on/x-java-applet"
and/or
<object code="java:Some Applet.class"
or the IE/Win
<object classid="

I think if you use the <object> element to embed your Java applet then a
safe way should be to give it an id attribute and then use
var applet;
if (document.getEl ementById && (applet =
document.getEle mentById('objec tId')) && typeof applet.methodNa me !=
'undefined') {
applet.methodNa me();
}
to call a method if available. That doesn't depend on the browser making
an applet available in document.applet s but is supported from IE 5+,
Netscape 6+, Mozilla, Opera 6+.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
On Wed, 19 Jan 2005 19:08:34 +0100, Martin Honnen wrote:


Neil Cherry wrote:
I've seen references to using <applets ... > and document.applet s to
access public Java functions from Javascript. Do I still use
document.applet s with <object ...>?
Good question but hard to answer, I think that will depend on the
browser and even with a particular browser


I'm currently using Netscape (Firefox 1.0) but I'd like to see it work
(same code or as close as possible) with IE 6.
or the IE/Win
<object classid="
I'm currently using this for IE & Netscape and it correctly calls up
the Java Applet under both (I also use the object in an object with
<!--[if !IE]> trick).
I think if you use the <object> element to embed your Java applet then a
safe way should be to give it an id attribute and then use
var applet;
if (document.getEl ementById && (applet =
document.getEle mentById('objec tId')) && typeof applet.methodNa me !=
'undefined') {
applet.methodNa me();
}
to call a method if available. That doesn't depend on the browser making
an applet available in document.applet s but is supported from IE 5+,
Netscape 6+, Mozilla, Opera 6+.


Excellent! That's what I'll do. Thanks for the help and not poking fun
at my calling the Java method a function. My background is Assembler &
C, so they're all subroutines to me. :-) And I'm doing this for fun
and on-my-own-time education. Thanks again!

--
Linux Home Automation Neil Cherry nc*****@comcast .net
http://home.comcast.net/~ncherry/ (Text only)
http://hcs.sourceforge.net/ (HCS II)
http://linuxha.blogspot.com/ My HA Blog
Jul 23 '05 #3
On Wed, 19 Jan 2005 11:19:19 -0600, Neil Cherry <nj*@wolfgang.u ucp>
wrote:
BTW, the FAQS page seems to be broken.


Do you mean
<URL: http://jibbering.com/faq/ > ?

as I don't know of it being down recently, the logs certainly don't
show any holes.

Jim.
Jul 23 '05 #4
On Thu, 20 Jan 2005 23:18:00 GMT, Jim Ley wrote:
On Wed, 19 Jan 2005 11:19:19 -0600, Neil Cherry <nj*@wolfgang.u ucp>
wrote:
BTW, the FAQS page seems to be broken.


Do you mean
<URL: http://jibbering.com/faq/ > ?

as I don't know of it being down recently, the logs certainly don't
show any holes.


Oops, sorry about that, forgot the T. The broken site is:

http://JavaScript.FAQTs.com/

--
Linux Home Automation Neil Cherry nc*****@comcast .net
http://home.comcast.net/~ncherry/ (Text only)
http://hcs.sourceforge.net/ (HCS II)
http://linuxha.blogspot.com/ My HA Blog
Jul 23 '05 #5

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

Similar topics

6
4496
by: 2obvious | last post by:
This is a pipe dream, I realize, but I'm trying to emulate the functionality of the W3C DOM-supported document.getElementsByTagName method under the very nightmarish Netscape 4. Through some sleuthing, I was able to find what serves as a document.getElementById emulator at http://www.xs4all.nl/~ppk/js/dhtmloptions.html#versionb. (Below is the code; this clever algorithm is painstakingly explained at the site above.)
3
2396
by: Rosinger | last post by:
Hi all, What is the preferred in term of browser copatability to get a reference to an element in the document in JavaScript? I am not sure about when to use document.all or document.layers or document.getElementByID. Are they all doing the same thing? Cheers,
6
6830
by: David List | last post by:
I'm having a problem using different properties of the document object in the example javascripts in my textbook with browsers that identify themselves as using the Mozilla engine. One example of these problems is using document.layers. I have Google'd for examples of how to use the document object specifically with Mozilla, but I cannot find anything that explains why my problems occur. Could anyone here see through the included example...
40
3153
by: Eitan | last post by:
Hello, I know Java-Applet (written for JBuilder). I would like to know about dotnet technology, pros and cons in comparation to Java-Applet technololgy. Can I write a program in dotnet, like Java-Applet, compile it, debug it, and put it as a class on an HTML (like Java-Applet). I would like to introduce to the dot net technology. Give me some samples, please, and a comparation to Java-Applet technology.
2
1949
by: Art | last post by:
Is document.embeds still a part of the current/latest javascript DOM ?
12
4756
by: Wladimir Borsov | last post by:
On one of my web pages there is an java applets which works fine on my computer. However I noticed on some other computer that the run of java applets are disabled. I got an error message "Classnotfound" Is there a way to detect (with cgi resp. javascript) if java applets are allowed? I would like to show a simple picture instead of the applet pane if applets are not allowed. Wladimir
6
3684
by: skubik | last post by:
Hi everyone. I'm attempting to write a Javascript that will create a form within a brand-new document in a specific frame of a frameset. The problem is that I can create the form and input element using createElement(), but when I go to append the form element into the new document, the script halts and I get the following error in my Javascript Console (Firefox 1.0): __tmp_newDoc.body has no properties.
2
2061
by: Monte Gardner | last post by:
At my company, we have a javascript function that uses document.write() calls to create an INPUT tag with type set to "image". The image that it is downloading comes from a dynamic image server, so it has lots of stuff in the query string, including ampersands. The image that I'm getting in my web page as a result of this call is not configured correctly. After some investigation, I've found that the document.write() call seems to be...
2
2460
by: Manish Naik | last post by:
Hi, Using ASP.Net, I want to store and retrive documents (Word, excel, etc) from SQL Server 2000 database. I have tried image type data field, but could not succed. Can any one help me please. Regards, Manish Naik
0
7987
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
8392
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...
1
8050
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8264
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
6718
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
5850
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
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2412
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1504
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.