good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: How to make ajax requests in Dancer2by fishmonger (Chaplain) |
on Aug 26, 2014 at 20:45 UTC ( [id://1098672]=note: print w/replies, xml ) | Need Help?? |
Ok, I found the solution which utilizes the Dancer2::Plugin::Ajax module and is much cleaner. The route is now ajax '/p_details/:tab' => sub { return params->{tab}; };I dropped the 2 javascript functions (partner_details and partner_tab) previously posted and am now using this function.
That other js function was moved to the external js file to remove the clutter in the template file, which is now:
So, now when I click on the "folder tab" link, it displays the tab name as the main content of the "folder". Now I just need to write the sub that queries the db and builds the table to be displayed.
In Section
Seekers of Perl Wisdom
|
|