aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes help with jquery server responds with whole page 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 "help with jquery server responds with whole page" Watch "help with jquery server responds with whole page" New topic
Author

help with jquery server responds with whole page

caleb momanyi
Ranch Hand

Joined: Jun 17, 2012
Posts: 43

What's up fellow ranchers. pretty rough day out in the fields for for me. I have started learning jquery and am trying to get a string from the server but when
i do alert(response) i find that the response is the whole jsp page from the server. how can i get just the string only. i have heard of JSON and if any one of you can
help me get started will be very thankful.

get method in servlet



jquery

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

The response will contains whatever /chat returns as the response. It has nothing at all to do with what you are doing on the client. If you only want a string, then /chat has to return just that string, not a whole page.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
caleb momanyi
Ranch Hand

Joined: Jun 17, 2012
Posts: 43

thank you for your response sir. my problem is how to stop it from returning the whole page.

most of the examples I am seeing only explain the client side methods of handling the the response but not so well explanation for server side.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

That entirely has to do with the server-side code that's responding to the /chat url. What it it? A servlet? Something else? Whatever it is, it needs to be changed to return just what you want rather than what you do not.
caleb momanyi
Ranch Hand

Joined: Jun 17, 2012
Posts: 43

using print writter?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

I have no idea. You have given us no details whatsoever on the server component.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help with jquery server responds with whole page