This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
anish reddy
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 982
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you talking about an applet? Its public methods are available to javascript.
 
anish reddy
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65228
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic