xavier gagneur

Greenhorn
+ Follow
since Jul 26, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by xavier gagneur

Originally posted by Charlie Boss:
i don't know about using eval.. but this is how i call show an alert..
Object[] arguments = {"test"};
arguments[0] = "No Information retrieved from database.";
win.call("alert", arguments); // KRASH HERE

Hi Charlie,
That is the same problem when I use the win Object in applet
with the Java plug-in!
If i use the applet tag in HTML, that's OK but with the Object tag to use the plug-in it always crash IE.So I can't use JSObject
+win.call --> CRASH
+win.eval --> CRASH
+win.getMember(..) --> CRASH
But I don't know why it's work fine in the init methode.
If you can use JSObject with the plug-in help me please.
x.
22 years ago

Originally posted by Frank Carver:
As far as I am aware, this is not possible. I needed to do it some months ago, and wrote some diagnostic JavaScript to traverse the whole JavaScript object tree, and did not find any mention of my applet.
Applets in a Plug-in can call JavaScript, but the reverse seems just not possible. In the end I had to make my applet sit in a thread, waiting and polling a JavaScript variable until the JavaScript set it.


Hi,
I can call Java Methode in Applet using plug-in but I can't Call Javascript from Java.
That is my problem! Just see that...
///////////////////
//HTML SOURCE
<html>
<HEAD>
<SCRIPT code="JavaScript">
function writeHtml(nbr){
document.writehtml.writeHtml(nbr);
};
</SCRIPT>
</HEAD>
<BODY>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="300" height="300" codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win.cab#Version=1,3,0,0"
name="writehtml">
<PARAM NAME=CODE VALUE=HtmlWriter>
<PARAM NAME="codebase" VALUE=".">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="true">
<PARAM NAME="MAYSCRIPT" VALUE="true">
</OBJECT>
<FORM name="resto">
Nombre de lignes a g�n�rer : <input name="result" type="text" value="5"><BR>
<input type="button" onclick="javasript:writeHtml(document.resto.result.value)" value="OK">
</FORM>
</BODY>
</HTML>
//////////////////////
//JAVA JAPPLET SOURCE
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import netscape.javascript.*;
public class HtmlWriter extends JApplet{
JSObject win = null;
public void paint(Graphics g){
g.setColor(Color.black);
g.drawString("APPLET RUN...", 15,35);
}

public void writeHtml(String Nombre){
win.eval("alert('TEST2');"); // CRASH HERE!!!
}
public void init(){
win = JSObject.getWindow(this); //OK
win.eval("alert('TEST');"); //No PROBLEMES HERE
repaint();
}
}
22 years ago
Hi,
I am currently trying to communicate with applet and JavaScript
See my source code please and help me, I do't understand why it crash in IE with plig in Java 1.3.1
Many Thanks
x.
///////////////////
//HTML SOURCE
<html>
<HEAD>
<SCRIPT code="JavaScript">
function writeHtml(nbr){
document.writehtml.writeHtml(nbr);
};
</SCRIPT>
</HEAD>
<BODY>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="300" height="300" codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win.cab#Version=1,3,0,0"
name="writehtml">
<PARAM NAME=CODE VALUE=HtmlWriter>
<PARAM NAME="codebase" VALUE=".">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
<PARAM NAME="scriptable" VALUE="true">
<PARAM NAME="MAYSCRIPT" VALUE="true">
</OBJECT>
<FORM name="resto">
Nombre de lignes a g�n�rer : <input name="result" type="text" value="5"><BR>
<input type="button" onclick="javasript:writeHtml(document.resto.result.value)" value="OK">
</FORM>
</BODY>
</HTML>
//////////////////////
//JAVA JAPPLET SOURCE
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import netscape.javascript.*;
public class HtmlWriter extends JApplet{
JSObject win = null;
public void paint(Graphics g){
g.setColor(Color.black);
g.drawString("APPLET RUN...", 15,35);
}

public void writeHtml(String Nombre){
win.eval("alert('TEST2');"); // CRASH HERE!!!
}
public void init(){
win = JSObject.getWindow(this); //OK
win.eval("alert('TEST');"); //No PROBLEMES HERE
repaint();
}
}
22 years ago