Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

286
Vistas
Obteniendo un error 404 al intentar ejecutar la página html

Estoy tratando de enviar una cadena de PHP a una variable en JSON. Pero cada vez que se carga la página, aparece un error de recurso 404 por algún motivo. No entiendo qué está pasando y por qué sigo recibiendo este error. Recibo el error después de que la página web ejecuta la parte del script del código. La forma en que revisé esto fue usando el kit de desarrollo en Google Chrome.

Estoy ejecutando PHP a través de Microsoft IIS.

ObtenerInfoArchivo.php

 <?php //Calls the getFileInfoMainFunction getFileInfoMainFunction(); //Function : sscaddir //Parameters : $dir //Returns : array //Description : This function takes an array where we get rid of the dots function sscandir($dir) { return array_values(array_diff(scandir($dir),array('..','.'))); } function getFileInfoMainFunction(){ //variables $implodedFilesEqual; $toJson; //C:\localwebiste\holmes-e-joesph-r $fileDirectory=dirname(__FILE__); //now we are in the MyFilesDirectory $fileDirectory.="\MyFiles"; //store all the files in the filedirectory in an array $files=sscandir($fileDirectory); //The '|' delimter //This is the string that we will send too the client side code. $implodedFilesEqual=implode("|",$files); //For testing purpose print_r($files); $toJson=json_encode($implodedFilesEqual); echo ($implodedFilesEqual); //Test.txt|test3.txt } ?>

página HTML:

 <html> <head> <title>Starting Page</title> <link rel="stylesheet" href="StartPage.css" media="screen"> <script src="https://ajax.googleeapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="jQuery.js"></script> </head> <body id="theTextEditorsBody"> <p id="demo"></p> <h1>Text Editor</h1> <hr> <textarea id="textArea"></textarea> <br> <select> <option>textFile1</option> <option>textFile2</option> <option>textFile3</option> </select> <p id="hello"></p> </body>

jQuery.js:

 const xmlhttp=new XMLHttpRequest(); xmlhttp.onload=function(){ const myObj=JSON.parse(this.responseText); document.getElementById("demo").innerHTML=myObj.name; } xmlhttp.open("POST","GettingFileInfo.php"); xmlhttp.send();
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda