Created
August 3, 2016 14:39
-
-
Save chauncey/d3aa734ae7ef9d718c64439298f1761c to your computer and use it in GitHub Desktop.
policy-search-api-2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="site-wrapper"> | |
| <div class="site-wrapper"> | |
| <div class="site-wrapper-inner"> | |
| <div class="inner cover"> <h1>Search</h1> | |
| <p class="lead"> | |
| <a href="#" class="btn btn-lg btn-default" onclick="polsearch();">Search</a> | |
| </p> | |
| <div id="result"> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function polsearch() { | |
| let api = "https://policy-search-api.herokuapp.com/policy-search/api/v1.0/policies?callback=?"; | |
| let callback = function( response ){ | |
| console.log( response ); | |
| $( "#result" ).html( JSON.stringify( response , null, 2) ); | |
| }; | |
| $.getJSON( api, { | |
| status: "renewal", | |
| state: "all" | |
| }).done( callback ) | |
| .fail( function( xhr ){ | |
| alert("error " + xhr.responseText); | |
| }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Bootstrap */ | |
| /* | |
| * Globals | |
| */ | |
| /* Links */ | |
| a, | |
| a:focus, | |
| a:hover { | |
| color: #fff; | |
| } | |
| /* Custom default button */ | |
| .btn-default, | |
| .btn-default:hover, | |
| .btn-default:focus { | |
| color: #333; | |
| text-shadow: none; /* Prevent inheritance from `body` */ | |
| background-color: #fff; | |
| border: 1px solid #fff; | |
| } | |
| /* | |
| * Base structure | |
| */ | |
| html, | |
| body { | |
| height: 100%; | |
| background-color: #333; | |
| } | |
| body { | |
| color: #fff; | |
| text-align: center; | |
| text-shadow: 0 1px 3px rgba(0,0,0,.5); | |
| } | |
| /* Extra markup and styles for table-esque vertical and horizontal centering */ | |
| .site-wrapper { | |
| display: table; | |
| width: 100%; | |
| height: 100%; /* For at least Firefox */ | |
| min-height: 100%; | |
| -webkit-box-shadow: inset 0 0 100px rgba(0,0,0,.5); | |
| box-shadow: inset 0 0 100px rgba(0,0,0,.5); | |
| } | |
| .site-wrapper-inner { | |
| display: table-cell; | |
| vertical-align: top; | |
| } | |
| /* Padding for spacing */ | |
| .inner { | |
| padding: 30px; | |
| } | |
| /* | |
| * Cover | |
| */ | |
| .cover { | |
| padding: 0 20px; | |
| } | |
| .cover .btn-lg { | |
| padding: 10px 20px; | |
| font-weight: bold; | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment