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

336
Vistas
jQuery load file not working, blank page?

I'm trying to import the contents of a file (the file itself dosen't matter, html, php, text) - in all cases, I am unable to get any content loaded in. I've even used direct copy past off tutorials and it does not load or work?. I guess I'm missing something, or there is a version conflict maybe?.

HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>test</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">

 <script type="text/javascript">
   jQuery(document).ready(function(){
       jQuery("#new").load("new.html);
   });
</script>
</head>
<body>
 
<div id="new"></div>
 
</body>
</html>

This code is taken directly from jQuery website, I've only changed the file being loaded to "new.html" and yes, I have that named file in the same directoy. I've tried both referencing the source from online, and using local jquery file, tried different browsers as well.

When testing, the browser shows a blank page, it's not displaying the text?.

Any ideas what I'm doing wrong?

Thanks,

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should do this instead of JQuery

$(document).ready(function(){
   $("#new").load("new.html");
});

// OR

$(function(){
  $("#new").load("new.html");
)};

And I would recommend using

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>

The reason this wasn't working is that JQuery is deprecated (meaning it shouldn't be used and will error most of the time) you should use $ since it is not deprecated and is the new way to do it. Also you did load("new.html) you missed a extra "

about 4 years ago · Juan Pablo Isaza Denunciar
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