473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

document.applets & object

I've seen references to using <applets ... > and document.applets to
access public Java functions from Javascript. Do I still use
document.applets 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 3265


Neil Cherry wrote:
I've seen references to using <applets ... > and document.applets to
access public Java functions from Javascript. Do I still use
document.applets 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="application/x-java-applet"
and/or
<object code="java:SomeApplet.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.getElementById && (applet =
document.getElementById('objectId')) && typeof applet.methodName !=
'undefined') {
applet.methodName();
}
to call a method if available. That doesn't depend on the browser making
an applet available in document.applets 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.applets to
access public Java functions from Javascript. Do I still use
document.applets 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.getElementById && (applet =
document.getElementById('objectId')) && typeof applet.methodName !=
'undefined') {
applet.methodName();
}
to call a method if available. That doesn't depend on the browser making
an applet available in document.applets 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.uucp>
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.uucp>
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
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...
3
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...
6
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...
40
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...
2
by: Art | last post by:
Is document.embeds still a part of the current/latest javascript DOM ?
12
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...
6
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...
2
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,...
2
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. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.