The Artima Developer Community
Sponsored Link

Java Answers Forum
Java & JavaScript, strange things happen...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Sebastian Voitzsch

Posts: 1
Nickname: sebastian
Registered: Sep, 2002

Java & JavaScript, strange things happen... Posted: Sep 3, 2002 6:45 AM
Reply to this message Reply
Advertisement
Hi all!

I?d like to use a applet HTML editor on my page. The one I found on www.hexidec.com/ekit.php works great and so I took it. Now I?d like to read/set the text to edit using JavaScript. The editor already has a function "getDocumentText()", which I call with an onClick-Event in my page:

<input type="button" name="gettext" value="gettext" onClick="document.myForm.HTML.value=document.Ekit.gettext();">

For changing the text from outside the applet, I added a method "setDocumentText()":

public void setDocumentText(String newtext)
{
jptMain.setText(newtext);
jptSource.setText(jptMain.getText());
}

On my page I have a textarea input and two buttons (set/get the text). The settext-button code is similiar to the above gettext example:
<input type="button" name="settext" value="settext" onClick="document.Ekit.setDocumentText(document.myForm.HTML.value);">

This code behaves very seldom. Sometimes it works as I expect it to do, sometimes the browser hangs; I have to kill the java_vm processes then. When I show the java console in Mozilla, it seems as there is a endless loop generating events (ie calls to the function) - but where are those events coming from? I did only a single mouseclick!
Same with Win2k/IE 5.x - sometimes it does, sometimes the browser dies...

Any hints / solutions on this?

Thx,
Sebastian

Topic: Simple Java code for me Previous Topic   Next Topic Topic: Database connection pooling

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use