[dancer-users] Dancer2::Plugin::Database side effects?
Mike Cu
mike_cu80 at yahoo.com
Wed Sep 23 17:08:55 BST 2015
It's nothing special :$( "#City" ).selectmenu({
select: function( event, ui ) {
$.ajax({ url: '/cities',
type: "POST",
data: {'City':$("#City" ).val()}}).success(function(data){
$("#display").html(data);});
},
});
I don't know how related it can be,as I've just reverted to the old pre Plugin code and everything works fine.When I use the Plugin I get those side effects
On Wednesday, September 23, 2015 3:13 PM, Stefan Hornburg (Racke) <racke at linuxia.de> wrote:
On 09/23/2015 01:28 PM, Mike Cu wrote:
> I've replaced all my
> $dbh = DBI->connect, $sth = $dbh->prepare calls with
> the Dancer2::Plugin::Database equivalents
> Before that, when there was interaction with the UI, I would explicitly connect, run all my sql and then disconnect, on every Ajax call .
>
> After I switched to Dancer2::Plugin::Database,I have to do the same interaction, for example, clicking a button which invokes an Ajax call which in turn calls the database retrieving the new data and updates the UI, does not have an immediate effect ,the UI is not being updated. So I have to do the same move (click a second time) for getting the desirable outcome
>
> Has that something to do with caching and reusing the connection?
>
It shouldn't - how does your code for the Ajax call looks like?
Regards
Racke
--
Perl and Dancer Development
Visit our Perl::Dancer conference 2015.
More information on https://www.perl.dance.
_______________________________________________
dancer-users mailing list
dancer-users at dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150923/5e529d43/attachment.html>
More information about the dancer-users
mailing list