The post->success->data variable is empty..
Posted
by Asaf
on Stack Overflow
See other posts from Stack Overflow
or by Asaf
Published on 2010-05-10T16:41:48Z
Indexed on
2010/05/10
16:44 UTC
Read the original article
Hit count: 227
Hello, I tried sending some data like so:
<form action="http://www.someurl.com/something.php" id="login">
<input type="textbox" id="UserName" value="user">
<input type="textbox" id="Password" value="password">
<input type="submit" value="submit">
</form>
<div id="result"></div>
<script type="text/javascript">
$('form#login').submit(function() {
$.post($('form#login').attr('action'), $('form#login').serialize(), function(data) {
$('#result').html(data+'222')
});
return false;
});
</script>
Now, the value of #result div change to 222... that is: the post was successful but for some reason there is no data, and when I go directly to something.php and post manually, it does bring back data (am I mistaken or does the post(success(data)) variable returns the whole page returned after you post something? if so, how could it be?)
Thank you very much for your help
© Stack Overflow or respective owner