I know that PHP is a server-side script while JS is the client-side thus when the page loads, it will load PHP before JS thus it is impossible to do so. What I want is an alternative method to perform my JS task which is to take the value after the ? in the address bar (//localhost/Task/delete.php?ID=1).
var url = window.location.href;
var params = url.split('?ID=');
var fdf = (params)
$random = $_GET["fdf"];
Can someone please help me?