Full width home advertisement

Post Page Advertisement [Top]

POST is basically used for sending form data to server and recive output from the server.
jQuery $.post() function sends and request data from the server using HTTP POST.

Syntax: $.post(url,postData,CallBack);

url: A string contains the url, to which request is send.

postData: Form data for sending.....

CallBack: a function which execute when the request succeeds.


username: $("#txtusername").val(),
password: $("#txtpass").val()
},function(success, data)
alert("Server Sends: " + data);

Full Example:
<!doctype HTML>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
   $("#result").html("Please Wait.............");
                      username: $("#txtusername").val(),
                      password: $("#txtpass").val()

<div id="result"></div>
<br />
<form name="f1">
Username: <input type="text" id="txtusername" placeholder="UserName" /><br />
Password: <input type="password" id="txtpass" placeholder="Password" />
<input type="submit" id="btn" value="Submit" />

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib