f5 - refresh only the frame - html

Is it possible to refresh only one frame in the windows and not all the frames?
My problem is that i have a page index.php and inside there are two frames - menu and content. when the user clicks on refresh(f5) the index.php has been loaded again and the content page is blank.
What can i do?

If you are familiar with javascript's usage in page refresh. You can try that instead of traditional html do a job.
javascript:location.reload(false)
will do a page reload from the cache. Set this to your content page and for menu page you can set this.
javascript:location.reload(true)

What you can do is store the last page selected by the user in cookie (using client side code) then in the page load even (client side again) check for that cookie and if exists, load that page by default instead of showing blank page.
Using jQuery accessing cookies becomes really simple: http://plugins.jquery.com/project/Cookie

Related

What can cause Anchor Links to reload the page?

Recently, I've been working on a WordPress website powered by the Divi theme and builder. Some of the pages have a menu with the URLs set to ID's of certain sections of the page (anchor links) but when clicked, the page refreshes and then scrolls to the relevant section.
What would cause a page to refresh when an anchor link is clicked? I'm baffled!
I've tried changing the URLs (to the below) but still have the same problem.
https://www.domain.co.uk/tables/#breakpoint-one
https://www.domain.co.uk/tables#breakpoint-one
In static HTML, coding something like this would take a matter of minutes so I cannot understand why the page refresh occurs.
Is the refreshing ocurring only the first time you click on an anchored link? or does it happen every time.
Perhaps you have POST data present (like you arrived on the page after submitting a form). I think the behaviour you describe matches that scenario.

How to keep content on page on new page load

I want to know, how we can do the page reload but while loading the page we keep some conten on page visiable.
In real senario, google or facebook load new page or chages some part of the page(not using the ajax) but there header or footer are not get change means stick to page and it visible through-out the process to page load start and end.
Can anyone tell me how it has to be done?
well, your examples don't reload page. They load new content with AJAX, so while loading you can execute your scipts and display current content. After you can append new blocks to page and change url using HTML5 History API.

Cache common blocks of HTML on each page

We have a common navigation bar on each page.
How would you cache this so it is not loaded on every page?
You could load it using AJAX in the onload event of each page and append it in the respective navigation container on your page.
As long as the request to the menu stays static, the browser should be able to cache the response. Hence, you have basically cached your menu on the client's browser.
Put the content into a variable inside a javascript file navigation.js
nav_bar = "....."
Then include this navigation.js on each page and insert the content in the current page via JavaScript.

Is there any way to request a page without displaying it?

If you link to something downloadable with a simple <a href, the user will download the file while staying on the current page. You can get this behavior with files that the browser has no plugin for (like .bin), or by sending a content-disposition header to force downloading.
Is there any method or header which keeps the user on the current page while still requesting the page? The idea is that the user clicks a link, the request is made, but the page doesn't change—like when downloading a file.
This could be done with an iframe I guess, which is not really pretty and makes another request when loading the page. Javascript is another obvious answer, but that's actually the reason for asking this question: compatibility with JS-less clients.
A form with the method set to HEAD is another ugly solution, but doesn't work anyway. Chromium ignores the method and simply performs a GET request...
Anymore ideas?
You could place an iframe on your page that is hidden. Then, give that iframe and id.
Use this id as the target of a link to the file you want to pull down.
I've created a demo at http://jsfiddle.net/dancrumb/N87nL/ to show you how this would work. Just style the iframe as being invisible and you're good to go
The page will load in the iframe, you'll stay on your page, it doesn't require JS. Oh boy!
Note that the iFrame doesn't have an initial value for src, so no request is made on page load.

how to design a simple one page website

i want to design a website who contain 4-5 page but i need a feature then when user click on any link the content is changed without any other page load. how i can do this
my page look like this
but when user click on left side or right side link the content is load without page refresh. how i can do this.
jQuery UI tabs?
http://jqueryui.com/demos/tabs/default.html
You can either use frames or load content via Ajax.