-
Notifications
You must be signed in to change notification settings - Fork 130
run javascript at first to avoid splash #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Just changed the order of the scripts. In most browsers (such as chrome), it will execute the javascript before page rendering. So that the page will redirect without the splash white screen :)
pathawks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it work just as well if we put it right above <h1>?
|
Of course. |
|
It seems the |
|
Not exactly. Most of the browsers will parse and execute the inline JavaScript as document order. For an exampleTry this code in Chrome <!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script>
alert(1);
location="https://github.com/";
</script>
<title>Title</title>
<meta http-equiv="refresh" content="0; url=http://jekyllrb.com/">
<script>
alert(2);
</script>
</html>It will alert and redirect to For current versionIt will display a screen like this screenshot, before jumping to new URL. For this PRIt will not show this screen unless the JavaScript is disabled (the |
|
@jekyllbot: merge +minor |

Just changed the order of the scripts.
In most browsers (such as chrome), it will execute the javascript before page rendering.
So that the page will redirect without the splash white screen :)