• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in passing form params in ajax call to a servlet

 
Bhavesh Sangwan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Experts .. ! I'm facing to send login params to a servlet using ajax call....

my code is listed below ....

sorry in advance for any stuppidity... actually i'm new to ajax..

so please guide some trics related to this problem....


Thanks....

ajax.js


form.html


When I make request then servlet does,t accept any request args.... I know that I'm doing something wrong... please correct my approach...
 
Rob Crowther
author
Ranch Hand
Posts: 297
5
Android Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're not sending any request args, why are you expecting to receive any? If you want to do a POST of form data with AJAX then there's a lot of work to be done. Often easier to append the variables to the query string in a GET request, or just use a library which handles the details for you like jQuery.
 
Bhavesh Sangwan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ! Problem again...

Actually when I send ajax request without params ,, then it is working fine...

but when I send some request with params then no data is sent to servlet and either no response is generated by the ajax response....

why please explain....

code is here.....

ajax code...



in above ajax code, params is javascript variable in string which i'm trying to send to the server.... but not sent and nor response is coming from servlet..

what to do....

Html file...




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic