Andy11548 Posted July 9, 2011 Share Posted July 9, 2011 Right, its the same problem, but I know where the problem is, I believe. If I use: <script type="text/javascript"> $(document).ready(function() { $('#memberResults').load('./includes/scripts/loadmembers.php').show(); $('#memberInput').keyup(function() { $('#memberResults').append('a'); }); }); </script> It works how the code says, to append the character 'a', each time a key is pressed. However, this code doesn't. <script type="text/javascript"> $(document).ready(function() { $('#memberResults').load('./includes/scripts/loadmembers.php').show(); $('#memberInput').keyup(function() { $.post('./includes/scripts/loadmembers.php', { member: form.member.value }, function(result) { $('#memberResults').html(result).show(); }); }); }); </script> This doesn't work with the 'html' part in <!DOCTYPE html. Could someone please teach me another way to write the posting method in javascript? Thanks, Andy. (PS, Sorry about the new post, but I've worked out what part is making the script not work and thought it'd be easier to make a new post, so that you can see, as many people don't bother looking at the last page for updates etc.) Quote Link to comment https://forums.phpfreaks.com/topic/241473-posting-method-problem/ Share on other sites More sharing options...
Andy11548 Posted July 9, 2011 Author Share Posted July 9, 2011 Right, I've some how, fixed the script through messing around with it, haha. The new script is now this: <script type="text/javascript"> $(document).ready(function() { $('#memberResults').load('./includes/scripts/loadmembers.php').show(); $('#memberInput').keyup(function() { var member = $('#memberInput').val(); $.post('./includes/scripts/loadmembers.php', { member: member }, function(result) { $('#memberResults').html(result).show(); }); }); }); </script> Which works out exactly how I want it to . Quote Link to comment https://forums.phpfreaks.com/topic/241473-posting-method-problem/#findComment-1240431 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.