65.9K
CodeProject is changing. Read more.
Home

Mitigate/Eliminate Browser Flashing with Simple Trick

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.94/5 (6 votes)

Feb 22, 2019

CPOL
viewsIcon

4085

Mitigate the browser flash between page navigation on your site

Introduction

This is a real quick tip for web developers:

I was working on a MVC5 web site, and changed to a theme with a dark background. I noticed that when I clicked a link that navigated to another page on the site, the entire browser window would flash a white background before rendering the new page.

I fixed this by moving all of the JavaScript loading to be the last thing in the body tag, and left all the CSS file loading at the top.

It was a simple fix to an annoying visual effect. It would be real nice if the MVC template was changed to reflect this paradigm.

History

  • 2019.02.22 - Initial publication