quite a noob question, but I tried to use php for the first time and can't get it to work...
I have the most basic php file
<?php
echo 'Hello World!';
?>
and I try to fetch the output and alert that. Just for learning how to do that...
My JS code (more or less like here):
fetch('./test.php').then(function(response) {
return response.text().then(function(text) {
alert(text);
});
});
Both file (test.php and the js file are in the same folder).
Could someone tell me what is wrong here?
Thanks, celdri
Via Active questions tagged javascript - Stack Overflow https://ift.tt/IfxcoWk
Comments
Post a Comment