Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: jQuery issue with Dancer2

by Your Mother (Archbishop)
on Sep 23, 2016 at 00:25 UTC ( #1172391=note: print w/replies, xml ) Need Help??

in reply to jQuery issue with Dancer2

Iím pretty handy with jQuery but itís hard to see whatís going on or how to test what youíre doing so Iím sorry I have no help, just a rude question. :P

I have had an armís length distaste for Dancer since its debutónot knowing it well enough to say while also not liking anything I do learn about itóbut is that really how URLs are handled? With hard-wired, string concatenation? Is there nothing like Catalystís uri_for(), uri_for_action(), or uri_with()?

Replies are listed 'Best First'.
Re^2: jQuery issue with Dancer2 (Dancer, URLs)
by tye (Sage) on Sep 23, 2016 at 05:53 UTC

    I'm no Dancer expert and I only have limited experience with using it. But that was still long enough for me to experience ETOOMUCHMAGIC from Dancer. Since then I have repeatedly seen evidence of more of that. I also see Dancer/2 suffering more from "framework disease" than Mojo does. Framework disease is where there is much rejoicing about how you can build a whole functioning system with just 1 trivial line of code. This then leads to major spelunking required to detangle all of the magic that was hidden in order to make all of those things dance with such little specified. The spelunking need can come up any time you want to do something even a little different than the default way.

    But then, the many things I built didn't even use Mojo. They just used Plack.

    As for building URLs with concatenation, I've just come to expect such stupidity from all web frameworks. Before I had experience, I expected building URLs properly would be something built directly into JavaScript. Then I expected it to be someplace obvious in jQuery. Then I expected Mason to handle such things. But I almost never find tools for doing that in such places. And I have never found code written by others and using such tools that builds URLs other than by concatenation, and only rarely is any escaping done before concatenation.

    - tye        

Re^2: jQuery issue with Dancer2
by stevieb (Canon) on Sep 23, 2016 at 00:31 UTC

    Thanks Your Mother, no rudeness spotted :)

    The Dancer part doesn't really matter, as I know that I'm receiving what I expect from the Perl Dancer part. It's how I'm handling the JS. In the get_aux() js call, when I alert() I get the expected result (from Perl). But in the creation of the button (the call that calls the get_aux() in the function above it in my OP), the alert() states undefined.

    I'm reading up on use of 'callbacks' et-al right now.

    What *is* rude, is me looking for JS help on Perlmonks ;)

      Oh, I love the occasional JS question, especially jQuery. I have said before, I really think it touches the same sweet spot Perl does in terseness + expressiveness. If you have runnable code somewhere (github gist?) I would probably play with it tomorrow.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2022-05-28 14:08 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (99 votes). Check out past polls.