473,763 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
+ 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.appletf rame.document.a pplets['mapApplet'].getMap();
map.setTool(too l);
}

and then an onClick is used to set the tool:

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

The frame holding the applet is named "appletfram e".

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 5407

Berend de Boer wrote:
>>"For" == For Example: John Smith <no**@host.inva lid> 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.appletf rame.document.a pplets['mapApplet'].getMap();
map.setTool(too l);
}

and then an onClick is used to set the tool:

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

The frame holding the applet is named "appletfram e".

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="setToo l(2);return false;">
<img "zoom.gif" alt="Zoom In" name="selecttoo l"></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
2894
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 applet to resize itself when I resize the html frame if it's in Netscape 7.x. Seems like the problem is the lack of a refresh signal to the java applet from the page. Is this a known bug, is there a workaround? Thanks. -Jeff
1
5938
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 the window or frame). I can sort of get an example working in a Mozilla browser: > <!-- This works on Mozilla only (and maybe netscape) --> > <script language="Javascript"> > document.write( "<applet code=MyApplet.class width=" > +...
0
5602
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 JSObject technique are Netscape technologies (or >related to). I want an alternate way of accessing the HTML DOM from >Java Applets and to call Methods on the Applets from JavaScript.
1
2634
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 results displayed on the same page with one column text and an image of the product. I've seen several tutorials that create site-level searches that will bring back a search results page with options to choose from. I am looking to create a...
2
12791
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 the window or frame). I'm trying to use Javascript to do so. I can sort of get an example working in a Mozilla browser: > <!-- This works on Mozilla only (and maybe netscape) --> > <script language="Javascript"> > document.write( "<applet...
1
5513
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 consol: sun.plugin.liveconnect.OriginNotAllowedException: Javascript is not form the same origin as je java code ... This is my html code:
2
1758
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 and the system. The information is latter sent to the site. How can I reference distinct Applets instances of the same Applet Class inside the page? How can I get the values stored in the Applet's variables using
2
5429
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 html, you can view its source. When I started using this applet, it worked on my system with Mozila/Netscape, Mozilla/Firebird, Mozilla/Firefox, and Internet Explorer, all running on my WindowsXP system. I was warned that the applet worked...
2
3520
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 -- <html> <head> <title>
0
9563
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
10145
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
9998
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9938
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
8822
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
7366
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
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
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
3
2793
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.