8

How would one go about staying on the CURRENT page until the NEXT page is fully loaded.

I've experimented with stuff like making the body

<body style='display: none'>

And then displaying it with Jquery upon full load but that's not what I'm looking for.

I would like for the user to stay on the current page (probably display a loader graphic BUT keeping the content of the current page - no blank pages etc) while the next loads and then.... BAM you pop the full page for display. Otherwise the page jumps around as it loads.

all tutorials or plugins do either the above or some like http://github.hubspot.com/pace/docs/welcome/ show a loading bar on the NEXT page while it's being fully loaded... but this still lets you see the elements jump around.

YOUTUBE has this (same as pace above) BUT it stays on the CURRENT page, shows the loader and then moves on to the next whereas pace goes to the next page and then shows a loader while the rest of the page gets loaded.

I hope I am making sense.

Thank you.

itamar
  • 3,837
  • 5
  • 35
  • 60
Noodle Head
  • 431
  • 3
  • 10
  • 23
  • 3
    To do this you'd need to dynamically load the next page, instead of relying on hyperlinks. You would need quite some JavaScript for this. – Joeytje50 Jan 29 '14 at 20:13
  • Use ajax? If ou are not concerned about the url staying the same that is. – Valamas Jan 29 '14 at 20:14
  • So any heads up at least in which direction I should look... any existing structures (plugins etc) that can do this? – Noodle Head Jan 29 '14 at 20:14
  • The URL would have to move to the new one... but it can move later on etc... Meaning that it doesn't have to be the instant the user clicks... If that makes any difference at all. – Noodle Head Jan 29 '14 at 20:16
  • 1
    See http://stackoverflow.com/a/3354511/1256925 for more info about what you're trying to do. – Joeytje50 Jan 29 '14 at 20:22
  • possible duplicate of [Modify the URL without reloading the page](http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page) – Joeytje50 Jan 29 '14 at 20:23
  • that looks very good. Combine that with some ajax for a sweet solution. – Valamas Jan 29 '14 at 20:24
  • @Joeytje50 - No duplicate. I am not looking to do that.. at all. – Noodle Head Jan 29 '14 at 20:24
  • @NoodleHead That link explains how YouTube does it, and you clearly state YouTube as the main example of what you're trying to do. So yes, this is what you're looking to do, clearly. – Joeytje50 Jan 29 '14 at 20:26
  • @Joeytje50 Okay I'll research it.. I guess the solution isn't registering with me yet because I'm not familiar with changing browser urls without refresh... – Noodle Head Jan 29 '14 at 20:33

1 Answers1

0

you need to use AJAX to load the page.

I think this is a good tutorial on how to do it: http://tutorialzine.com/2009/09/simple-ajax-website-jquery/

Ruben de Vries
  • 535
  • 5
  • 14