Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getResults() {
- fetch(universityData.root_url+'/wp-json/wp/v2/posts/?search='+searchField.value)
- .then(res => res.json())
- .then((out) => {
- resultsDiv.innerHTML = '
- <h2 class="search-overlay__section-title">General Information</h2>
- <ul class="link-list min-list">
- ${!out.length ? <p>No General Information Matches That Search<p>
- ${out.map(arr => '<li><a href="${arr.link}">${arr.title.rendered}</a></li>).join('')}
- </ul> '}
- ';
- }).catch(err => resultsDiv.innerHTML = <p>There was a problem with the search.<p>);
- isSpinnerVisable = false;
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement