Código:
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script> $(document).on("ready",function(){ loadData(); }); var loadData = function(){ $.ajax({ type:"POST", url:"../app/route.php" }).done(function(data){ console.log(data); }); } </script> </head> <body> HI </body> </html>
Código:
$functions->view('index'); echo json_encode(['hiiii']);