Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

79
Visualizações
Dynamic Pages using Jquery .load conflicts

I'm trying to make a single page website that loads pages to a div with a id of #content however sometimes my form elements gets mess up like datepickers and autocompletes not rendering. So i suspected that there's to many scripts to load and it cause conflicts since all of my pages has source links.

My first adjustment was to remove all source links from my child pages and move it to the main page. but when child pages load using jquery .load i get a bunch of errors on my consoles like autocomplete is not a function and Synchronous XMLHttpRequest. Any suggestions to fix this?

//My code to load pages.

$(".click").on("click",function(){

        var page = $(this).data('link');

        $("#content").html("<img src='img/142.gif' width='150' />").load(page);

        //console.log('Click function was called');

});

enter image description here

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

There are errors because the javascript source files loaded after but your javascript code executed first. You can use iframe element and in order to load new page dynamically change the src then reload the iframe.

$(".click").on("click",function(){

    var page = $(this).data('link');
    var iFrame = $('iframe');
    iFrame.html("<img src='img/142.gif' width='150' />");
    iFrame.load(page); 

});
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda