I want that some sections on my page to remain (like header, footer) and only the main content to change. In the same time, the URL should also change, according to the new content.
I know all about AJAX/iframes but I don't want to use them as the URL remains the same.
Take a look please at 123contactform.com. Try to play around with the left menu and notice that the main content changes and also the URL (while the header, menu, footer stays).
How is this achieved?
Thanks.
Refreshing part of a page periodically You can use the frame “reload” function periodically in frameset page itself. In the above code, “right_frame” reloads every second. setInterval() function is very closely related to setTimeout() – both have similar syntax: setInterval ( expression, interval );
Approach 1: One can auto refresh the webpage using the meta tag within the head element of your HTML using the http-equiv property. It is an inbuilt property with HTML 5. One can further add the time period of the refresh using the content attribute within the Meta tag.
This is typically achieved with a technique called AJAX. This technique loads data asynchronously (in the background) so it can update your content without needing to reload the page. The easiest way to implement AJAX is with the jQuery load() method.
Actually the webpage you give does not only refresh its content. It may look that way, but you can see that header is still flickering aka refreshing(also if you change the content live it will change when you click a link)
There is actually a whole new page. But they use templates to create the content.
One page is a template website that calls different fractions of the webpage(ie footer, header and content). Where the content can just have an other content based on the given input.
This can just be done with php.
Template.php
include "header.php";
include $contentpage;
include "footer.php";
Where you give differnt content file names that you want to load.
Header.php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Page title</title>
</head>
<body>
BLALBLA CONTENT
content.php
echo $content;
footer.php
</body>
</html>
This together will create one page wtih a dynamic content and a static header and footer( where you can also add static scripting).
This is just a basic idea on how you can achieve this.
The static content(header and footer) might as well be cashed to load it faster.
Additional info why i think this
Also when you open the link into a tab, you will see that every of that link will contain the header. As with, for example, an iFrame only the dynamic content will be shown in the link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With