-Karl- Posted August 26, 2012 Share Posted August 26, 2012 Hello, I'm using jQuery tabs and Ajax to send post data to an included page, but the data isn't being sent/received and I can't figure out why. Here's my jQuery. $(function() { var postData = {}; $( ".tabs" ).tabs({ select: function(event, ui) { $('#r').html('<div style="padding: 5px;"><img src="<?php echo BASE_URL.'themes/'.$theme.'/images/ajax-loader.png'; ?>" /></div>'); postData = { uid: parseInt($(ui.tab).data('uid')) }; }, ajaxOptions: { type: 'POST', data: postData, error: function( xhr, status, index, anchor ) { $( anchor.hash ).html( "<div style='padding: 5px;'>Content could not be loaded, sorry about that.</div>" ); } } }); $(".tabs ul li > a").attr('title', ''); }); And here's the tabs. <div class="tabs"> <ul> <li><a href="file1.php" data-uid="<?php echo $_GET['id']; ?>" title="r">File 1</a></li> <li><a href="file2.php" title="r" data-uid="<?php echo $_GET['id']; ?>">File 2</a></li> <li><a href="file3.php" title="r" data-uid="<?php echo $_GET['id']; ?>">File 3</a></li> </ul> <div id="r"></div> </div> In file1.php I have a print_r($_POST); But all that's shown is Array( ). Does anyone have any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/267590-jqueryajax-post-data-not-being-sent/ Share on other sites More sharing options...
Christian F. Posted August 26, 2012 Share Posted August 26, 2012 Tried checking what the contents of postData is, prior to sending the request? Also, where is the actual AJAX call? Quote Link to comment https://forums.phpfreaks.com/topic/267590-jqueryajax-post-data-not-being-sent/#findComment-1372551 Share on other sites More sharing options...
-Karl- Posted August 26, 2012 Author Share Posted August 26, 2012 Sorry should have updated this really. I fixed it myself. Quote Link to comment https://forums.phpfreaks.com/topic/267590-jqueryajax-post-data-not-being-sent/#findComment-1372590 Share on other sites More sharing options...
Christian F. Posted August 26, 2012 Share Posted August 26, 2012 What was the problem, and how did you fix it? Quote Link to comment https://forums.phpfreaks.com/topic/267590-jqueryajax-post-data-not-being-sent/#findComment-1372594 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.