0

I am implementing a plugin in my site, I have kept the required php and JS files on my server. But I couldn't figure out how to handle the JQuery callbacks mentioned here - https://github.com/polljoy/PollJoy-web#handle-callbacks-from-plug-in-optional

Kindly demonstrate with an example, how to retrieve the array of results. Your feedback will be appreciated.

   <script type="text/javascript">
        jQuery(window).load(function() {

            polljoy({
                endPoint : 'connect.php'
            }, function PJPollIsReady(polls){
                console.log(polljoy('show'));   
            });


        });
    </script>
3
  • 1
    @NoLifeKing sample code updated! Commented May 4, 2014 at 7:34
  • If you move the callback-code outside the polljoy-block, does it work? (I can't really set this up at the moment to test). So that the PJPollIsReady is after the semicolon of the polljoy-command. Commented May 4, 2014 at 7:37
  • Nope! It gives error, undefined polls Commented May 4, 2014 at 7:46

1 Answer 1

1

Sample for PJPollDidShow event

jQuery(window).load(function() {

    polljoy({
        endPoint : 'connect.php',
        PJPollDidShow: function(poll){
           //Here is the callback for the PJPollDidShow event
        }
    });
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.