http://qs1969.pair.com?node_id=1172393


in reply to jQuery issue with Dancer2

So what is the issue/problem?

You need to summarize the question, like why is state empty  $.get(host +'/get_aux/' + aux, function(state){

I suggest you study Mojolicious::Lite +and jQuery +AJAX + Mojo::Template both the perl and the javascript (and references), as headers (like content type) matter, and so does handling failure

Replies are listed 'Best First'.
Re^2: jQuery issue with Dancer2 (a problem summary)
by stevieb (Canon) on Sep 23, 2016 at 01:09 UTC

    Thank you.

    I think I stated the problem clearly... that state is returned from the Perl Dancer2 call here: $.get(host +'/get_aux/' + aux, function(state){ as you said, but as soon as I leave that function (and get to its outer, surrounding called function), the return is undef. I'm sure it's just that I'm not explaining/understanding the JS language properly. In other words... FFS, it should be like Perl ;)

    I'll have a read-through of the docs you supplied.

    Cheers,

    -stevieb

      I think I stated the problem clearly....

      :) I didn't see any question marks or any sentence in the form of a question :D

      Consider this format

      Title: question here?
      question here again?
      setup
      data
      code
      diagnostics
      details 
      question here again?
      signature