Embed Code JavaScript Issue

When I use an embed code block for custom HTML with the following JavaScript in the footer, the page goes white, and I have to exit the editor to get the page back, only to see that the entire embed code block is blank.

<script>document.write(new Date().getFullYear())</script>
731 Views
Message 1 of 6
Report
5 REPLIES 5
Square

Hi @chrisbowyer Someone may be able to help you out with this, but can you provide your full url and the code you are using in the embed code element? Thanks! 

719 Views
Message 7 of 6
Report

https://www.engadinetavern.com.au/

This works

<p><small>Copyright &copy; 2018-2019 Engadine Tavern. ABN: 26 715 894 612. All rights reserved. Web Developer: <a href="https://www.chrisbowyer.com.au/" target="_blank" rel="noopener noreferrer">Chris Bowyer</a> - <a href="https://www.portaldomains.com.au/" target="_blank" rel="noopener noreferrer">Portal Domains</a></small></p>

This doesn't

<p><small>Copyright &copy; 2018-<script>document.write(new Date().getFullYear())</script> Engadine Tavern. ABN: 26 715 894 612. All rights reserved. Web Developer: <a href="https://www.chrisbowyer.com.au/" target="_blank" rel="noopener noreferrer">Chris Bowyer</a> - <a href="https://www.portaldomains.com.au/" target="_blank" rel="noopener noreferrer">Portal Domains</a></small></p>

The only difference being the first uses

2019

and the second uses

<script>document.write(new Date().getFullYear())</script>

just plain old vanilla JavaScript

718 Views
Message 7 of 6
Report
Square

Thanks for posting. 

@BJ Do you have any thoughts? 

704 Views
Message 7 of 6
Report

I have the same problem please help
672 Views
Message 7 of 6
Report
Square

Some code may potentially cause issues within the editor, depending on how it works. You might want to consult with a Javascript developer so they can take a look, since that would be beyond the kind of support we can provide.

669 Views
Message 7 of 6
Report
This thread has been archived and locked. Please start a new thread if you would like to continue the conversation.