summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-03-08 18:57:29 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-03-08 18:57:29 +0800
commit9185a79cc2034faf0dfd4dcab2ba7cf56dc6af56 (patch)
treeaa581e8ff26afe9870c4ab7d184e924a748d6bfc /index.html
parentad014ab8dc23fe888bff144f812236106beceb6a (diff)
downloadweb-9185a79cc2034faf0dfd4dcab2ba7cf56dc6af56.tar.xz
Load grecaptcha asynchronously.
Diffstat (limited to 'index.html')
-rw-r--r--index.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/index.html b/index.html
index 7559c93..754d7d6 100644
--- a/index.html
+++ b/index.html
@@ -17,7 +17,6 @@
<link rel="stylesheet" type="text/css" href="theme2b.css" id="theme2b">
<link rel="stylesheet" type="text/css" href="theme3a.css" id="theme3a">
<link rel="stylesheet" type="text/css" href="theme3b.css" id="theme3b">
-<script src="https://www.google.com/recaptcha/api.js?render=6LdCZ5AUAAAAAPL9Fooi8Zh3m0VTepvpNR9S4G5L"></script>
<style>
reduced{font-size:75%;}
#msgform{width:50%;margin:auto;}
@@ -121,8 +120,15 @@ function swonload(){
else unsetevents();
}
window.onresize();
- if(grecaptcha)
- grecaptcha.ready(function(){recaptcha=grecaptcha;});
+ const grse=document.createElement('script');
+ grse.src="https://www.google.com/recaptcha/api.js?render=6LdCZ5AUAAAAAPL9Fooi8Zh3m0VTepvpNR9S4G5L";
+ grse.async=true;
+ grse.onload=function()
+ {
+ if(grecaptcha)
+ grecaptcha.ready(function(){recaptcha=grecaptcha;});
+ };
+ document.head.appendChild(grse);
loadTheme();
if(!location.hash.length)contsw('main');
else contsw(location.hash.substr(1));