mirror of
https://github.com/KevinMidboe/Node-Com-Handler.git
synced 2025-10-29 17:50:27 +00:00
Added a search bar and button
This commit is contained in:
@@ -4,14 +4,21 @@
|
||||
<title>tmdb.org Search Displayer</title>
|
||||
</head>
|
||||
<body>
|
||||
<input type='text' id='link_id'>
|
||||
<input type='button' id='btnSearch' value='Search' onClick="search(this)"'>
|
||||
<p id="display"></p>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
function request(id){
|
||||
console.log(id);
|
||||
var button = document.getElementById("btnSearch");
|
||||
|
||||
button.onclick = function () {
|
||||
var text = document.getElementById("link_id").value;
|
||||
console.log(text);
|
||||
queryTMDB(text);
|
||||
}
|
||||
|
||||
function queryTMDB(query) {
|
||||
var data = "{}";
|
||||
|
||||
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);
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user