Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/04/2015, 15:59
jaume5900
 
Fecha de Ingreso: octubre-2012
Mensajes: 9
Antigüedad: 11 años, 7 meses
Puntos: 0
Problema con JSON.encode

Tengo el problema que al mandar desde php el echo json_encode($x); se me muestra en el documento, y a su vez, lo que me manda es toda la pagina en HTML dentro del JSON...

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']);