Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

171
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!