<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 4/30/2015 12:49 PM, Andrew Beverley
      wrote:<br>
    </div>
    <blockquote cite="mid:1430419777.8909.37.camel@andy-laptop"
      type="cite">
      <pre wrap="">On Wed, 2015-04-29 at 16:12 -0600, John J. McDermott, CPLP wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">
In a template I invoke (successfully) from a Dancer2 path I have some
jquery that works outside Dancer2:
$.post('/data1.pl',data,function(returnData){
        $('#func').html(returnData)

This code calls data1.pl and stuff its output into the div func.

I know data1.pl works in a non-Dancer2 environment. But I cannot
figure out where to put data1.pl so it can be run from the template.</pre>
      </blockquote>
    </blockquote>
    <blockquote cite="mid:1430419777.8909.37.camel@andy-laptop"
      type="cite">
      <pre wrap="">
Surely the "correct" way of doing this is to rewrite data1.pl into your
main Dancer app, as its own route? Is there any reason that you cannot
do that?</pre>
    </blockquote>
    Well I have a page accessed through a template. Let's call the
    template x.tt. Now I want to somehow change the content of a div on
    that page. I know how to do that. But the code is perl. If I
    redirect through another route, it will reload the page or
    potentially have other issues as it only returns a brief string
    (i.e) not JSON, or am I incorrect?<br>
    <blockquote cite="mid:1430419777.8909.37.camel@andy-laptop"
      type="cite">
      <pre wrap="">

</pre>
      <blockquote type="cite">
        <pre wrap=""> I tried just putting it in the dancer public (where the css folder,
dispatch.cgi and such are), but that didn't work.
</pre>
      </blockquote>
      <pre wrap="">
I would keep it out of there, as it's nothing to do with Dancer.

</pre>
      <blockquote type="cite">
        <pre wrap=""> I tried even to run it from the browser command line and the browser
wants to download it. The directory has +ExecCGI and Dancer2 runs.
</pre>
      </blockquote>
      <pre wrap="">
If you have to keep it separate to Dancer, then that's the way to do it.
Put it in a completely separate area of your web server, and ensure it
can be executed as its own independent script.

If the browser is trying to download it, then something is wrong with
your webserver configuration. I'm sure people will be happy to try and
assist, but that is not a Dancer problem, it is a generic web/perl
problem.</pre>
    </blockquote>
    Hmmm, the Dancer part is "where to executables go that can be called
    via a browser viewing a Dancer-generated template?<br>
    <br>
    Thanks!<br>
    --john<br>
    <br>
    <blockquote cite="mid:1430419777.8909.37.camel@andy-laptop"
      type="cite">
      <pre wrap="">

Andy


_______________________________________________
dancer-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a>
<a class="moz-txt-link-freetext" href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a>
</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      John J. McDermott, CPLP<br>
      Learning and Performance Consultant<br>
      jjm at jkintl.com 575/737-8556<br>
      Check out my <a href="http://cybersecurity.learningtree.com">
        security blog posts</a><br>
      Add an A for the Arts To STEM and get STEAM and a strong engine to
      move forward. </div>
  </body>
</html>