aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes how to call java method in java script and return type should be setted as title Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "how to call java method in java script and return type should be setted as title" Watch "how to call java method in java script and return type should be setted as title" New topic
Author

how to call java method in java script and return type should be setted as title

anish reddy
Ranch Hand

Joined: Apr 19, 2008
Posts: 74
can any one give information on how to call java method in java script and return type from that method should be setted as title for the html.
code snippets do that.
Ivan Jozsef Balazs
Rancher

Joined: May 22, 2012
Posts: 867
    
    5
Are you talking about an applet? Its public methods are available to javascript.
anish reddy
Ranch Hand

Joined: Apr 19, 2008
Posts: 74
i want to call in html ,i am using java 1.6.is it possible to call in scriplet of html
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

To call back to the server requires the use of Ajax.

Using jQuery (recommended), it as easy as: $('title').load('/path/to/servlet');

The servlet should return the text to be inserted into the title element.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61206
    
  66

P.S. If you don't understand why you can't just call a Java method from the browser, please read this article to understand how JSP operates and why you can't do that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to call java method in java script and return type should be setted as title