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

175
Visualizações
Ajax page load Undefined

I have a problem of my page redirect into Undefined. I have not much experience in coding. I am using some of the code that I have found here. I am using a simple ajax page load code.

    $(document).ready(function() {
      // load index page when the page loads
      $("#response").html("DEFAULT");
      $("#page1").click(function() {
        // load home page on click
        $("#response").html("https://apemedia.my/without-reload-home/");
      });
      $("#page2").click(function() {
        // load about page on click
        $("#response").html("https://apemedia.my/without-reload-contact/");
      });
      $("#page3").click(function() {
        // load contact form onclick
        $("#response").html("https://apemedia.my/without-reload-about/");
      });
    
    });

The ajax page load effect is working and I continue to implement some fade in fade out effects with it. The fade in effect is alright, and also the fadeout effect seems working, but then when the page redirect, it redirect "Undefined".

$(document).ready(function () {
  $('#et-main-area').css('display', 'none');
  $('#et-main-area').fadeIn(3000);

$('.link').click(function(event) {
    event.preventDefault();

     newLocation = $('.link a').attr("href");
    $('#et-main-area').fadeOut(2500, newPage);
  });

  function newPage() {
    window.location = newLocation;
  }
        
});
about 4 years ago · Juan Pablo Isaza
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