const fakeResponseData = {
"data": [
{
"aliases": [],
"banner": null,
"firstAired": "1975-9-9",
"id": 77174,
"image": "/banners/images/missing/series.jpg",
"network": "NBC",
"overview": "Welcome to the Joe Forrester guide at TV Tome. Joe Forrester looked at the life of a regular cop on the beat, a patrolman who had been working the same district for many years. He felt friendships and information sources he had cultivated were worth more than the comfort of a patrol car or detective status. He occasionally overlooked minor infractions of the law, but was known and respected and trusted by everyone. His girlfriend Georgia Cameron and good buddy Bernie Vincent were always bailing him out of trouble when he chose to help those in dire need.",
"poster": null,
"seriesName": "Joe Forrester",
"slug": "joe-forrester",
"status": "Ended"
},
{
"aliases": [],
"banner": null,
"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"
}]
};
let TOKEN_SESSION_ID = null;
function getAutocompleteField() {
return document.getElementById('searchSeriesText');
}
function getSearchButton() {
return document.getElementById('searchButton');
}
function getSearchResults() {
return document.getElementById('searchResults');
}
function getSearchTerm() {
return getAutocompleteField().value;
}
function parseResponse(response) {
return response ? response.data : [];
}
function getMatchingSeries(seriesName) {
const request = sendHttpRequest('GET', `https://api.thetvdb.com/search/series?name=${seriesName}`);
return Promise.resolve(request)
.catch(console.error);
}
function sendHttpRequest(type, url, params) {
/* return new Promise((resolve, reject) => {
var xhttp = new XMLHttpRequest();
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.