Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to return just the value not whole HTML?

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am reading HRA (Head Rush Ajax) and unfortunately they have used PHP as server side technology.

I am confuse with this point.

Server returns the response (just the value not the whole HTML) and browser puts that into request's responseText property and we can get it in JS function.

First, how to return just the value from servlet???

Second, how can I return multiple values if I want???

I hope my questions are clear.
[ September 27, 2006: Message edited by: rathi ji ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don;t put HTML on the page, just the code you want to return.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlet can return any data you want, not just an HTML page.

It can return a JSON structure for example, which can contain as much information as you like and is easily evaluated in the Javascript.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Eric and Bear.

I am able to do it.



Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic