How is data in a site change without ajax request or url changed?

Viewed 127

I was looking at the https://www.dotnetperls.com/ and when i click on 'C#' link in the page the page loads with different content and i dont see any ajax request in the Network tab in the browser and there no url change also.

How is this achieved?

2 Answers

That's because the content is already loaded into the page when you first visit the site. If you look at Event Listeners in Chrome for the link, you'll see javascript hooked in to change the rendered HTML element on click.

The whole content is loaded in the first request and when you click on "C#", the default content and the rest is displayed using JavaSript without loading anything new.

If you click on "examine this element" in your browser for the "C#" link, you'll see that the content is still in the page after the "new" content was displayed, it was just hidden.

Related