Plugin: Using jQuery with Poll Position
- Overview
- Get Poll Position
- Compare Poll Position and Poll Position: Champion
- Install and Configure
- Template Tags
- Use
- Poll Position: Champion Results Template
- Using Poll Position with jQuery
- Changelog
- Looking for support? Use the Helpdesk.
By default, Poll Position uses the YUI JavaScript library to help everything work smoothly. Movable Type (and some related tools) have been moving towards standardizing on the jQuery library over the past few months. With that in mind, it’s been on my radar that Poll Position should offer a jQuery option. Thanks to Reed for jumping ahead and creating this!
The following steps will work to use jQuery with both Poll Position and Poll Position: Champion.
Get jQuery
You’ll need a few pieces to get Poll Position working:
- Download the current jQuery library.
- Download the jQuery Form Plugin.
Upload these to your site, perhaps into a folder named jquery/.
Modify Your Template’s <head>...</head>
In the Poll Position installation instructions you added required templates.
In place of the line <mt:Include module="YUI Javascript"> that you added between the <head> and </head> tags, you’ll want to use:
<script type="text/javascript" src="http://yourdomain.com/jquery/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="http://yourdomain.com/jquery/jquery.form.js"></script>
Note the path to the to the jQuery files you uploaded and be sure to correct them for your site.
Update pollposition.js
Replace the default code in your pollposition.js template with the following:
Lastly, republish pollposition.js and any affected templates!