in reply to Re^3: Loading values into template using Perl and Mojolicious::Lite
in thread Loading values into template using Perl and Mojolicious::Lite

I did, to try loading the template again, but there no need for that I realized. The "/get_status" route gets call by ajax once the page loads.Could that be the issue?
# Load value into Main template, # but I cant get the results to display on the template. # $c->render( # template => 'main', # ); # this is the tag in the template <TMPL_VAR NAME="result"> $c->stash( result => ' This is the result for testing' ); # I also return json from the sql query results, which it was called + from ajax # and it works fine. return $c->render(json => $data );
But it still doesn't work.
  • Comment on Re^4: Loading values into template using Perl and Mojolicious::Lite
  • Download Code

Replies are listed 'Best First'.
Re^5: Loading values into template using Perl and Mojolicious::Lite
by Corion (Patriarch) on Mar 31, 2017 at 19:07 UTC

    I don't think that the stash will be included if you render JSON data.

    Put all your data into $data.

    Note that I don't use Mojolicious much, so I can only guess and read the documentation.

      I know, it wont, unless I included like you mentioned. But if I do I have to read into the template using jquery. I was wondering if it could be a two separated thing.