policy-search-api-2
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
/* 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;
}
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
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);
});
}
<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>