Aurora078 Posted October 7, 2010 Posted October 7, 2010 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. Quote
Zeggy Posted October 7, 2010 Posted October 7, 2010 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... Quote
Dave Posted October 7, 2010 Posted October 7, 2010 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 Quote
Djkanna Posted October 8, 2010 Posted October 8, 2010 Also for this I'd use $.ajax({}); it's possibly a bit more expandable than the post helper. Quote
Aurora078 Posted October 8, 2010 Author Posted October 8, 2010 Also for this I'd use $.ajax({}); it's possibly a bit more expandable than the post helper. I was thinking of using ajax strictly for the error function it allows that post doesnt. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.