EFAFAdmin Posted October 20, 2020 Share Posted October 20, 2020 Site URL: https://evergreenfineartsfestival.com Hi my site has many pages that include the current year and some other data. I'm trying to inject that data via the head tag by clicking into Settings->Advanced->Code Injection, then on the pages using a code block to access the data. The code injection is: <script type="text/javascript"> var year = "2021"; var lastYear = "2020"; var nextYear = "2022"; var event = "55th"; var friday = "27"; var saturday = "28"; var sunday = "29"; function docWrite(variable) { document.write(variable); } </script> And the content looks like this in a code block: <h2 style="text-align:center;white-space:pre-wrap;"><strong><script>docWrite(year)</script> Juror</strong></h2> This is working fine on the home page, but on all other pages the variables aren't populated when I load the page. I have to click on refresh to make them appear. When I look at the page source everything appears to be where it should be. Any ideas or help would really be appreciated! Link to comment
tuanphan Posted October 21, 2020 Share Posted October 21, 2020 Home > Design > Site Styles > Disable Ajax Loading Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
EFAFAdmin Posted October 21, 2020 Author Share Posted October 21, 2020 Awesome! That worked. Thanks so much for your help! Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.