Re: How to communicate from HTML page with an IP which is not the web-server?
- From: Dag Sunde <me@xxxxxxxxxxxx>
- Date: Sun, 13 May 2007 20:01:25 +0200
DavidNorep wrote:
As Daniel say, you can do it with AJAX:Maybe I was not clear enough - I do not want that the communication
* You send an XMLHTTP call to the server.
* A server-script do the connection to the external port you
want (Servers don't have the cross-domain security restriction).
* When the server script get the response from your external call,
it returns HTML or XML to your JavaScript in your original page.
will pass through the HTTP server, but directly between the two home
computers. So I assume that XMLHTTPRequest is not a solution.
If you want to do it With an Applet, ...So I want to do this in Java. I understand that you say that doing it
in Java means doing it with an applet, which may be invisible.
Just one point to be aware of:I thought that the HTML page is loaded and then the init() method of
If you call the (signed) Applet method that do the priviledged
task from a Javascript statement on the page, the method will
fail with a security exception. The JRE will notice that the call
came from a non-privilegded system (in this case JavaScript).
To walk around this, call a method in the Applet that only set
a flag, indicating that you want the method executed, and make
your Applet poll for this flag regularly.
the applet is invoked. Can you invoke from Javascript any public
method in the applet?
Yes, You can...
Something like this:
if ( document.getElementById('yourAppletId') ) {
var myApplet = document.getElementById('yourAppletId');
myApplet.yourmethod();
}
--
Dag.
.
- References:
- How to communicate from HTML page with an IP which is not the web-server?
- From: DavidNorep
- Re: How to communicate from HTML page with an IP which is not the web-server?
- From: Daniel Dyer
- Re: How to communicate from HTML page with an IP which is not the web-server?
- From: Daniel Dyer
- Re: How to communicate from HTML page with an IP which is not the web-server?
- From: DavidNorep
- Re: How to communicate from HTML page with an IP which is not the web-server?
- From: Dag Sunde
- Re: How to communicate from HTML page with an IP which is not the web-server?
- From: DavidNorep
- How to communicate from HTML page with an IP which is not the web-server?
- Prev by Date: Re: Query:is there the concept of priority level in java's event response system?
- Next by Date: Re: ID of thread that waken up by notify()
- Previous by thread: Re: How to communicate from HTML page with an IP which is not the web-server?
- Next by thread: Re: How to communicate from HTML page with an IP which is not the web-server?
- Index(es):
Relevant Pages
|