Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Latest commit

 

History

History
48 lines (37 loc) · 2.02 KB

README.md

File metadata and controls

48 lines (37 loc) · 2.02 KB

Find Your Rep Widget: Canada

A basic jQuery plugin that renders a form into the specified target, geocoding input and displaying results from Open North's Represent API.

This plugin extends and reuses code from the Sunlight Foundation's jQuery Find-Your-Rep plugin.

For another take on this, check out The Tyee's plugin and demo.

Example

Try the demo (a good test address is A1A1A1 for St. John's, NL). The full example code is:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Find Your Rep example</title>
    <link rel="stylesheet" href="css/jquery.findyourrep.min.css" />
    <script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
    <script src="js/jquery.findyourrep-pack.min.js"></script>
    <script src="js/jquery.findyourrep.ca.min.js"></script>
</head>
<body>
    <script>
        $('body').append('<div class="fyr"></div>')
                 .find('div.fyr')
                 .findYourRep({apis: 'represent'});
    </script>
</body>
</html>

Usage

  1. Link, in this order:
  2. jQuery
  3. dist/js/jquery.findyourrep-pack.min.js from jQuery Find-Your-Rep
  4. dist/js/jquery.findyourrep.ca.min.js from this package
  5. Call findYourRep({apis: 'represent'}) on an element:
    $('.myDiv').findYourRep({apis: 'represent'});

For further documentation, see the jQuery Find-Your-Rep plugin.

Copyright (c) 2014 Open North Inc., released under the BSD3 license