Aurora078 Posted October 7, 2010 Share 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 Link to comment Share on other sites More sharing options...
Zeggy Posted October 7, 2010 Share 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 Link to comment Share on other sites More sharing options...
Dave Posted October 7, 2010 Share 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 Link to comment Share on other sites More sharing options...
Djkanna Posted October 8, 2010 Share Posted October 8, 2010 Also for this I'd use $.ajax({}); it's possibly a bit more expandable than the post helper. Quote Link to comment Share on other sites More sharing options...
Aurora078 Posted October 8, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
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.