QUESTION Load ajax subpage - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16) +--- Thread: QUESTION Load ajax subpage (/showthread.php?tid=6580) |
Load ajax subpage - werty1001 - 2014-07-19 Hi. This code echo all subpage. How show only 10 subpage and another load after with ajax. PHP Code: function getSubMenu($page){ Code: $.ajax({ RE: Load ajax subpage - shawn_a - 2014-07-19 Slice the array using the page number via query string See array_slice RE: Load ajax subpage - werty1001 - 2014-07-19 (2014-07-19, 13:08:57)shawn_a Wrote: Slice the array using the page number via query stringThanks, i add this code in functions.php PHP Code: if($_POST['ajaxload']) { Code: $('body').on('click', '#load', function() { But onclick error Quote:<b>Fatal error</b>: Call to undefined function getChildren() RE: Load ajax subpage - shawn_a - 2014-07-20 are you tying to run this outside of GS ? pretty sure thats is indeed a function in core, you are trying to load it directly outside of GS just submit to index not functions. RE: Load ajax subpage - werty1001 - 2014-07-20 (2014-07-20, 00:30:50)shawn_a Wrote: are you tying to run this outside of GS ?This php code is in functions.php my theme of GetSimple. Simple code work PHP Code: if($_POST['ajaxload']) { return 20. But when i try PHP Code: if($_POST['ajaxload']) { return [object Object] and POST /functions.php 500 (Internal Server Error) RE: Load ajax subpage - shawn_a - 2014-07-20 you do not send forms to your functions you send them to your index. functions is loaded in global scope automatically and your code will run. RE: Load ajax subpage - shawn_a - 2014-07-20 You also want to wrap it in a function and call in your template somehow if you want to use core functions RE: Load ajax subpage - werty1001 - 2014-07-20 (2014-07-20, 01:58:29)shawn_a Wrote: you do not send forms to your functions you send them to your index. (2014-07-20, 02:39:42)shawn_a Wrote: You also want to wrap it in a function and call in your template somehow if you want to use core functions I have bad english and knowledge of php , I still don't understand why it doesn't work. Could you write a working example code? RE: Load ajax subpage - werty1001 - 2014-07-27 I make file ajax.php in my theme, global functions will be work when ajax call it? How i can do it work? |