Hi,
For Example: John Smith wrote:
[color=blue]
> 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.[/color]
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