perl_help26 has asked for the wisdom of the Perl Monks concerning the following question:
Hello I am starting to learn more about perl in Dancer. I have a trivial question about javascript. Not sure what I am doing wrong so this is the code. It's not alerting. In views/index.tt :
<script type="text/javascript"> $(document).ready(function(){ $.get("/", function() { alert ('ALERTING'); }); }); </script> <div id='about-content'>Test Div</div>
In test.pl:
use Dancer; use strict; use warnings; use Dancer ':syntax'; use Dancer::Plugin::Ajax; our $VERSION = "1.0"; set serializer => 'JSON'; set template => 'template_toolkit'; get '/'=>sub{ template 'index'; }; dance;
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using javascript for dancer perl app
by tobyink (Canon) on Jan 24, 2014 at 14:09 UTC | |
by perl_help26 (Beadle) on Jan 24, 2014 at 15:26 UTC | |
by tobyink (Canon) on Jan 24, 2014 at 16:41 UTC | |
|
Re: using javascript for dancer perl app
by soonix (Chancellor) on Jan 24, 2014 at 16:13 UTC |