7
<script>
GoFullscreen();
location.reload(); // Browser automatically goes out of fullscreen on this
</script>

If I use this code in a web page it will go fullscreen, refresh, and the browser will automatically go out of fullscreen because of the refresh. I need the code to go fullscreen and refresh, without going out of fullscreen mode.

<script>
GoFullscreen();
RefreshPage(); // Refreshes the page without going out of fullscreen
</script>

Something along these lines

If you want to know why I'm trying to refresh the page like this, it's a work around to my other question here unless I get an answer there. If anyone knows how to reload data-processing-sources on a canvas that would make it so I didn't need this. Otherwise refreshing the entire page is the only way I know to reload the data-processing-sources.

Community
  • 1
  • 1
Cains
  • 883
  • 2
  • 13
  • 23

2 Answers2

5

You can put the content into an iframe that is 100% width by 100% height. Then make the iframe refresh itself. The page containing the iframe can be set to fullscreen and then the iframe refresh won't cause the parent page to lose its fullscreen mode.

Some helpful info about fullscreen via JS: How to make the window full screen with Javascript (stretching all over the screen)

Scott
  • 3,736
  • 2
  • 26
  • 44
  • 2
    I have no problem going into fullscreen mode, my problem is that when I refresh the page while in fullscreen mode it goes out of it while I need it to remain in fullscreen mode. – Cains Sep 09 '13 at 21:15
  • 1
    I guess I was too vague with the wording, maybe my edit of the question will help you to understand my problem. – Cains Sep 09 '13 at 21:35
  • Can you try an iframe approach? Do you happen to have a JSFiddle that you could share? – Scott Sep 10 '13 at 13:19
  • 1
    Using an iframe and refreshing the frame whenever I resize it works for this and if they resize the window, so this actually solves this problem and another I have, thank you very much! – Cains Sep 11 '13 at 02:48
  • Oh great, it was a shot in the dark, but I'm glad it's resolved. Cheers! – Scott Sep 11 '13 at 13:29
-1

Your question is not very detailed/descriptive of exactly the issue that you are encountering, so it makes responding with a good answer difficult. What I take away from it though is that it sounds like you should make an asynchronous http request using AJAX, so that only the information that you need is requested from the server, not your entire document again. You say that while you are in fullscreen you need some information on that same page to be refreshed, right?

Are you familiar with making AJAX requests at all? If not be warned... there's a steep learning curve. JQuery simplifies it a bit (API Documentation), but I think it is nice to learn it the plain vanilla JS way (Mozilla Dev Network Documentation)

Hope this is helpful.

rdgd
  • 1,451
  • 2
  • 18
  • 33
  • Sorry, I'll modify my question to try to make it easier to understand. Basically if you put a web page in fullscreen, and then use location.reload(); the web page will go out of fullscreen automatically. This is all I want, to use location.reload() without it going out of fullscreen automatically – Cains Sep 09 '13 at 21:29
  • Unless the settings of your document are to go fullscreen when you load it, which it seems they aren't, when you use location.reload() you are going to see the webpage as it was when you first loaded it.What about adding a new canvas element with JS after you go fullscreen? – rdgd Sep 10 '13 at 15:39
  • This method of having two canvas's and hiding one depending on whether the page is in fullscreen or not works and is a quick solution, though the other guys solution also solves another of my problems. Wish I could accept both of your answers. – Cains Sep 11 '13 at 02:47