Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: jQuery issue with Dancer2 (a problem summary)

by Anonymous Monk
on Sep 23, 2016 at 00:46 UTC ( [id://1172393]=note: print w/replies, xml ) Need Help??


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
      

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1172393]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-26 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found