Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing JavaScript Function of another Web-Application

 
sandeep lokhande
Ranch Hand
Posts: 120
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want Call a client side method of an Webapplication from outside that application,
Lets say from my application or script, so as to trigger the functionality of that web-application.

I think as we are accessing only client side JS, so we could call the method.

Is it possible? If yes then what should be the approch for the same? Thank you in Advance. :-)
 
Micael Carvalho
Greenhorn
Posts: 9
Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello sandeep,

In order to call a method outside the application, you have to provide one of the following:

- Webservice;
- RMI server; or
- Sockets server.

In every case, you should implement code in your web application to allow other proccess to comunicate with it and access its methods.
The closer to what you need is RMI, that literally allows you to invoke remote methods, but it will need that both sides to maintain an Interface of which methods may be called.

Please take a look on that.

Micael
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Micael Carvalho wrote:In order to call a method outside the application, you have to provide one of the following:

None of that is applicable to client-side JavaScript.

And no, you cannot call the JavaScript of another page that was not served from your own domain.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic