mirror of
https://github.com/KevinMidboe/Node-Com-Handler.git
synced 2025-12-08 20:38:52 +00:00
Added a search bar and button
This commit is contained in:
@@ -4,14 +4,21 @@
|
|||||||
<title>tmdb.org Search Displayer</title>
|
<title>tmdb.org Search Displayer</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<input type='text' id='link_id'>
|
||||||
|
<input type='button' id='btnSearch' value='Search' onClick="search(this)"'>
|
||||||
<p id="display"></p>
|
<p id="display"></p>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function request(id){
|
var button = document.getElementById("btnSearch");
|
||||||
console.log(id);
|
|
||||||
|
button.onclick = function () {
|
||||||
|
var text = document.getElementById("link_id").value;
|
||||||
|
console.log(text);
|
||||||
|
queryTMDB(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function queryTMDB(query) {
|
||||||
var data = "{}";
|
var data = "{}";
|
||||||
|
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
@@ -49,9 +56,11 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
xhr.open("GET", "http://localhost:63590/api/v1/plex/request?query=star+wars");
|
xhr.open("GET", "http://localhost:63590/api/v1/plex/request?query="+query);
|
||||||
|
|
||||||
|
console.log(data);
|
||||||
xhr.send(data);
|
xhr.send(data);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user