473,395 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to use ajax with jquery to send data to servlets?

Hello, How can I use jquery's post method to send a variable to my servlet, I am using a java web application, so far I have something like this

Expand|Select|Wrap|Line Numbers
  1.  $(document).ready(function() {
  2.                     $.post("updateStage", Stage, function(data) {
  3.                         alert("stage loaded perfectly" + data);
  4.                     });
  5.  
  6.                 });
  7.  
where updateStage is the servlet which I want to send data to, and stage is the string (peice of data I want to send)
Nov 21 '10 #1
1 3521
acoder
16,027 Expert Mod 8TB
Is it Stage or stage?

What's the value of the variable? Perhaps a map will be better - see examples.
Nov 28 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mazin07 | last post by:
I have a script that makes multiple requests to several sites. However, each request takes a little while. How can I get the PHP script to output data to let the user know that it's checking? ...
3
by: Senthil | last post by:
Hi all I'm new in ajax. How to upload a image using ajax..
5
by: Martin | last post by:
Hello NG, I've been doing some AJAX for a few weeks now. The basics worked fine so far, but now I've got the following problem which I can't solve: With AJAX you typically update/replace only...
13
by: Marvin Zhang | last post by:
Hi, I'm not familiar with web programming, but I have a problem here. I have a page. When a user click one button on it, I will use AJAX to request a PHP script which will do a bunch of tasks,...
9
by: Tim Johnson | last post by:
I'm an experienced web/CGI programmer, but new to ajax. I'd like to review some examples of how to post data from a form to server using AJAX. I have already created some examples successfully...
20
by: vjayis | last post by:
hi when i m trying to fetch data from one page to another page using ajax, i get an error message in IE., but it runs well in firefox., could anyone help me., here is my javascript code., ...
6
by: Zytan | last post by:
What's the best way? I could use sockets, but that's overkill. I could use pinvoke'd SendMessage() like Win32, but I assume there's a C# wrapper for this. What might it be? The receiving...
4
by: maminx | last post by:
hello, i have this function.. function getAllInfoCab() { var slmckdcoy = $("#companyCode").val(); var slmckdcab = $("#branchCode").val(); alert(slmckdcoy); alert(slmckdcab); ...
1
sid0404
by: sid0404 | last post by:
Hi I need to send data from my servlet to my html(which contains AJAX), so as per the motivation of the AJAX, this should be done without my webpage reloading / refresh. my code on the ajax...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.