WM - Search Bar
by Gabriel Vazquez
HTML
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<input type="text" id="searchSeriesText">
<ul id="searchResults"></ul>
JavaScript
/**
* Instructions:
* Create an auto complete search bar which must show the matching results of a mocked
* API call based on the captured text.
*
* Nice to have:
* - Imitate delays in the mocked API calls.
* - Imitate error responses from the mocked API calls.
* - Write tests for the functions created.
*/
const fakeResponseData = {
"data": [
{
"id": 77174,
"image": "/banners/images/missing/series.jpg",
"network": "NBC",
"poster": null,
"seriesName": "Joe Forrester",
"slug": "joe-forrester",
"status": "Ended"
},
{
"firstAired": "2017-8-16",
"id": 333867,
"image": "/banners/posters/333867-1.jpg",
"network": "DR3",
"poster": null,
"seriesName": "I Forreste Række",
"slug": "333867",
"status": "Ended"
},
{
"firstAired": "1994-07-06",
"id": 333869,
"image": "/banners/posters/333867-1.jpg",
"network": null,
"poster": null,
"seriesName": "Forrest Gump",
"slug": "333869",
"status": "Ended"
}
]
};
function main() {
}
main();