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

296
Vistas
Cómo obtener el contenido del archivo con Ajax - "Indefinido" devuelto

Tengo el código html/jquery que se muestra a continuación. Cuando abro la página, recibo una alerta "Indefinido" seguida de la alerta "Error - pcsdBase" de la función 'error' de ajax. El "indefinido" parece provenir de la biblioteca jquery ...

 // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; }

en la línea 9375 de esta biblioteca

mi codigo es

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>PhotoCompSoftware documentation</title> <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.0.js"></script> <script type="text/javascript"> function getText() { $.ajax({ type: 'GET', url: 'http://photocomp.uk/pcs-help/pcsdBase.html', dataType: 'text', success: function (txt, textStatus) { alert('text=' + txt) return txt; }, error: function (jqXHR, textStatus, errorThrown) { alert('Error - ' + section + '.html'); } }) } $(document).ready(function() { alert(getText()); }) </script> </head> <body> <p>Alert should say From file</p> </body> </html>

¿Qué estoy haciendo mal?

over 4 years ago · Santiago Trujillo
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