Answer the question
In order to leave comments, you need to log in
How to display data through the API on the page?
How to display html page data by json
if (isset($_POST['submit'])) {
$result = $_POST["input"];
}
else {
echo "ERROR";
}
fetch('https://jsonplaceholder.typicode.com/<?php echo "$result" ?>')
.then(response => response.json())
.then(json => console.log(json));
document.write
it, it displays {object Object} Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question