QUESTION How to use Ajax and retrieve data - 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 How to use Ajax and retrieve data (/showthread.php?tid=8431) |
How to use Ajax and retrieve data - vish93 - 2016-05-24 Hello guys, I have currently got a list of items displaying, which when clicked should reveal a modal with further details. Now, I have got the modal showing part to work via: Code: <div class="portfolio-modal modal fade" id="job-description" tabindex="-1" role="dialog" aria-hidden="true"> Then I have a custom plugin with this function, which should get the correct further details and display them: PHP Code: function include_job_details($thejob){ I call this function in the modal code above. The p tag with the class jobid is where I am setting the specific list item clicked and the variable value for $thejob via: Code: $('#job-description').on('show.bs.modal', function (event) { As you probably can tell very confusing, I just want to get the modal that pops up populated with the related information. The function works, I just need help on how I can set the variable $thejob or use ajax ? RE: How to use Ajax and retrieve data - morvy - 2016-06-01 I would use plugin Extra Router, or create a template file, create page ajax and then call it like domain.com/ajax?jobid=123 ..and you can call the function directly in ajax template file (but it's not ideal, Extra Router is much better option) RE: How to use Ajax and retrieve data - vish93 - 2016-06-01 (2016-06-01, 23:10:13)morvy Wrote: I would use plugin Extra Router, or create a template file, create page ajax and then call it like domain.com/ajax?jobid=123 ..and you can call the function directly in ajax template file (but it's not ideal, Extra Router is much better option) I got it to work in the end via ajax. |