in reply to embed jquery in perl

Why do you need HTML::JQuery? Why don't you just include jQuery.js in your client side code, and pass whatever you want to your server side code? You don't mention what your server side code uses CGI, Dancer... How do I post a question effectively?

Update: fixed typo in first sentence. Thanks MidLifeXis.

Replies are listed 'Best First'.
Re^2: embed jquery in perl
by Anonymous Monk on Jan 02, 2014 at 15:20 UTC

    Apologies for forgetting to mention that... It's simply a perl console script (no CGI involved etc) which will download the html. I want to use jquery simply to parse the html

      I see. How do you fetch the HTML? Does JavaScript populate the values of these checkboxes? Do you have some example HTML you could post?

      Update: If possible it may help if you posted the perl code you currently have.

        Currently, I haven't written any perl code yet. I'm still in the planning phase. I thought it might be possible to use jQuery.get to grab the page. If not, I can use either a perl module or curl/wget. The html is really not all that exciting. It has a bunch of input checkboxes that are checked manually (via human input). No javascript involved here. After retrieving the html, I was hoping to do something like this:
        <form> <div> <input type="checkbox" name="fruit" value="orange" id="orange"> <label for="orange">orange</label> </div> <div> <input type="checkbox" name="fruit" value="apple" id="apple"> <label for="apple">apple</label> </div> <div> <input type="checkbox" name="fruit" value="banana" id="banana"> <label for="banana">banana</label> </div> <div id="log"></div> </form> <script> $( "input" ).on( "click", function() { $( "#log" ).html( $( "input:checked" ).val() + " is checked!" ); }); </script>
        and somehow pull the identifiers of the checkboxes that are checked into a perl data structure. Again, thank you for your help here.