Jump to content
MakeWebGames

Send Data with jQuery $.post()?


Aurora078

Recommended Posts

var data = {
   username: $("#username").val(),
   password: $("#pasword").val()
}

$.post("page.php", data, callback_function);

function callback_function(data) {
   //process return data here
   $("#output").html(data);
}

 

There are lots of examples in the documentation...

Link to comment
Share on other sites

Ok, so i know how to send a post. My problem is, how can i send my data ( in this case a username and password ) to another page, and then get a response displayed in my div "output_"?

Any help will be much appreciated.

No offence to you because you are learning and so on.. But this was really lazy.

The creators off jQuery didn't write a complete documentation on every function and how to use them just for their own amusement?

http://docs.jquery.com/Main_Page

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...