473,467 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

onClick interaction with applet in Mozilla

Hello!

Javascript beginner here, looking for some help. I discovered this
problem tonight while playing with my site using Mozilla. I don't have
Netscape on this computer but I assume this problem would exisist there
as well.

I am interacting with a Java applet (open source, which I did not write)
using javascript. The author of the applet has provided basic
information regarding how javascript can be used to manipulate the applet.

For instance, this function is defined in my javascript file:

function setTool(tool){
var map=top.appletframe.document.applets['mapApplet'].getMap();
map.setTool(tool);
}

and then an onClick is used to set the tool:

<a href="#"><img "zoom.gif" alt="Zoom In" name="selecttool"
onClick="setTool(2)"></a>

The frame holding the applet is named "appletframe".

This works perfectly well in Internet Explorer. However, in Mozilla
(1.4), it does nothing. I get no errors, no nothing.

Can someone offer a suggestion as to how this could be made to work with
browsers other than IE? I have been (and continue to) search the
javascript manuals & google, but would appreciate your help if you can
offer any. It's rather frustrating researching a problem when the
browser doesn't even return an error.

Thank you!

Newsgroup replies only, please.
Jul 20 '05 #1
2 5388

Berend de Boer wrote:
>>"For" == For Example: John Smith <no**@host.invalid> writes:

For> This works perfectly well in Internet Explorer. However, in
For> Mozilla (1.4), it does nothing. I get no errors, no nothing.

You mean no errors in the Javascript console of Mozilla?


Well, actually...

It seems there's nothing wrong with it, after all.

For some reason, in Mozilla, I have to click and sort of hold the link
for a fraction of a second - then it works. In IE I just click & move &
it works.

Sorry for the bother, guess it's just the way Mozilla handles the
onClick event.

Thanks!
Jul 20 '05 #2
Hi,

For Example: John Smith wrote:
Hello!

Javascript beginner here, looking for some help. I discovered this
problem tonight while playing with my site using Mozilla. I don't have
Netscape on this computer but I assume this problem would exisist there
as well.

I am interacting with a Java applet (open source, which I did not write)
using javascript. The author of the applet has provided basic
information regarding how javascript can be used to manipulate the applet.

For instance, this function is defined in my javascript file:

function setTool(tool){
var map=top.appletframe.document.applets['mapApplet'].getMap();
map.setTool(tool);
}

and then an onClick is used to set the tool:

<a href="#"><img "zoom.gif" alt="Zoom In" name="selecttool"
onClick="setTool(2)"></a>

The frame holding the applet is named "appletframe".

This works perfectly well in Internet Explorer. However, in Mozilla
(1.4), it does nothing. I get no errors, no nothing.

Can someone offer a suggestion as to how this could be made to work with
browsers other than IE? I have been (and continue to) search the
javascript manuals & google, but would appreciate your help if you can
offer any. It's rather frustrating researching a problem when the
browser doesn't even return an error.

Thank you!

Newsgroup replies only, please.


IMG tags have no ONCLICK event handler. IE interpretes what you want to
do and does something, whereby Mozilla reacts correctly and does
nothing. IE often does this kind of things, which is why it's always
better to develop in Mozilla and to check if it works in IE afterwards.

To solve your problem, try this:

<a href="#" onClick="setTool(2);return false;">
<img "zoom.gif" alt="Zoom In" name="selecttool"></a>

Note however that if the applet is an OBJECT tag, you cannot script it
in Mozilla, this is a documented error. Only APPLET tags can be scripted.

Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch

Jul 20 '05 #3

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

Similar topics

3
by: Jeff T. | last post by:
I have an applet that sizes itself to the size of the browser frame that it is running in. On IE the applet resizes upon dragging the frame divider. I'm having a problem with getting this...
1
by: Put 030516 in email subj to get thru | last post by:
I've always been bothered about having to statically declare the size of a Java applet window (container?) in the calling HTML. I've always wanted the moral equivalent of width=50% statement (of...
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...
1
by: D. Lee Christopher | last post by:
Can anyone point me to a good tutorial for creating a site-level search applet? I am trying to create a virtual catalog of sorts, and I would like to be able to search the catalog and have the...
2
by: Put 030516 in email subj to get thru | last post by:
I've always been bothered about having to statically declare the size of a Java applet window (container?) in the calling HTML. I've always wanted the moral equivalent of width=50% statement (of...
1
by: Jean-Luc Gyger | last post by:
Hello, I have on a html page an applet. A javascript function call one function of this applet. It works with IE but not with Mozilla or Netscape. I obtain the following error on the java-plugin...
2
by: Roberto Gallo | last post by:
Hi; I have two problems regarding Scripts and Applets. I need to construct a page that has some instances of the same Applet. These instances are responsible to get informations from the user...
2
by: Nick Wedd | last post by:
Here is a test page http://www.maproom.org/maps/historical/droysens/1886/testj.html which uses a Java applet to take a .DjVu format file and display the image which it encodes. The page is simple...
2
by: Andrew Neiderer | last post by:
This is simple HTML, Java but I am really confused. I include the code since it is so small - ---------------------------------------------------------------------------- -- test.html -- ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
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...
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,...
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: 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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.