Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How a web page can communicate with a web server while a user type characters in an input field.

Answer Posted / Sinchan Kanti Jana

A web page can communicate with a web server while a user types characters in an input field by using AJAX (Asynchronous JavaScript and XML). You can use techniques like long polling, Comet or WebSockets to achieve this. These approaches allow the browser to send requests to the server as soon as a character is typed in the input field, without requiring a full page refresh.nnHere's an example using jQuery:

```html
<input type="text" id="txtInput">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
function updateData() {n $.post('process-input.aspx', { input: $('#txtInput').val() }, function(data) {n // Handle the response from the servern });n }n setInterval(updateData, 1000);
});
</script>
```
In this example, we use jQuery's `$.post` method to send the input value to the server every second (via `setInterval`). The server-side code processes the input and sends a response back to the client.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category