Basic Steps:
-
The first step to add a poll in your webpage is to include the Polls Anywhere script:
<script type="text/javascript" src="https://www.ipaboa.com/media/com_communitypolls/anywhere/anywhere.js"></script>
You can add the script to your website/blog either inline to your page or head section of the page.
-
Polls Anywhere execution starts by creating the Polls Anywhere engine constructor by passing the ID of the poll.
<div class="cjpollsanywhere"><input type="hidden" /></div>
PollsAnywhere({id: 1, anywhere: true});
-
In the above code, cjpollsanywhere is the container name where the Polls Anywhere loads its content. The default container class name is cjpollsanywhere.
<div class="cjpollsanywhere"><input type="hidden" /></div>
Advanced Steps: Loading multiple polls on same page
-
If you want to add more than one poll on same page, you must use different container with different class name for each poll. Ex:
<div class="cjpollsanywhere1"><input type="hidden" /></div>
<div class="cjpollsanywhere2"><input type="hidden" /></div>
-
The polls must be loaded separately using different engine constructors.
PollsAnywhere({id: 1, container: 'cjpollsanywhere1'});
PollsAnywhere({id: 1, container: 'cjpollsanywhere2'});
Advanced Steps: Loading different charts
-
You can customize the chart type used to display the results.
PollsAnywhere({id: 1, chart: 'global', width: 300, height: 200});
Where CHART_TYPE is the chart type you would like to use. Default value is global as decided by site administrator.
Possible poll types are bar, pie, sbar and gpie. Please contact administrator for supported chart types by the website.