This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Move scripts to the bottom of the page

This should help speed up page rendering.
  • Loading branch information...
fmarier committed Mar 19, 2013
1 parent 4fd71c1 commit b1a8464363a08fe0bcd1f4cee69f2294414b9364
View
@@ -15,26 +15,27 @@ const loginform = `
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
- <script src="https://login.persona.org/include.js"></script>
- <script>
- function login() {
- navigator.id.get(function(assertion) {
- if (assertion) {
- var assertion_field = document.getElementById("assertion-field");
- assertion_field.value = assertion;
- var login_form = document.getElementById("login-form");
- login_form.submit();
- }
- });
- }
- </script>
</head>
<body>
<form id="login-form" method="POST">
<input id="assertion-field" type="hidden" name="assertion" value="">
</form>
<p><a href="javascript:login()">Login</a></p>
+
+ <script src="https://login.persona.org/include.js"></script>
+ <script>
+ function login() {
+ navigator.id.get(function(assertion) {
+ if (assertion) {
+ var assertion_field = document.getElementById("assertion-field");
+ assertion_field.value = assertion;
+ var login_form = document.getElementById("login-form");
+ login_form.submit();
+ }
+ });
+ }
+ </script>
</body>
</html>
`
@@ -4,6 +4,16 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>django browserid example</title>
+ </head>
+ <body>
+
+ <form id="login-form" method="POST" action="/status/">
+ {% csrf_token %}
+ <input id="assertion-field" type="hidden" name="assertion" value="" />
+ </form>
+
+ <p><a href="javascript:login()">Login</a></p>
+
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
@@ -16,16 +26,6 @@
}
});
}
- </script>
- </head>
- <body>
-
- <form id="login-form" method="POST" action="/status/">
- {% csrf_token %}
- <input id="assertion-field" type="hidden" name="assertion" value="" />
- </form>
-
- <p><a href="javascript:login()">Login</a></p>
-
+ </script>
</body>
</html>
@@ -4,6 +4,15 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>tornado browserid example</title>
+ </head>
+ <body>
+
+ <form id="login-form" method="POST" action="status">
+ <input id="assertion-field" type="hidden" name="assertion" value="" />
+ </form>
+
+ <p><a href="javascript:login()">Login</a></p>
+
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
@@ -16,15 +25,6 @@
}
});
}
- </script>
- </head>
- <body>
-
- <form id="login-form" method="POST" action="status">
- <input id="assertion-field" type="hidden" name="assertion" value="" />
- </form>
-
- <p><a href="javascript:login()">Login</a></p>
-
+ </script>
</body>
</html>
@@ -4,6 +4,15 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title>web.py browserid example</title>
+ </head>
+ <body>
+
+ <form id="login-form" method="POST" action="status">
+ <input id="assertion-field" type="hidden" name="assertion" value="" />
+ </form>
+
+ <p><a href="javascript:login()">Login</a></p>
+
<script src="https://login.persona.org/include.js"></script>
<script>
function login() {
@@ -16,15 +25,6 @@
}
});
}
- </script>
- </head>
- <body>
-
- <form id="login-form" method="POST" action="status">
- <input id="assertion-field" type="hidden" name="assertion" value="" />
- </form>
-
- <p><a href="javascript:login()">Login</a></p>
-
+ </script>
</body>
</html>

0 comments on commit b1a8464

Please sign in to comment.