Skip to content
Discussion options

You must be logged in to vote

So some one tell my why CUSTOM CODE always give me these problems....

In this particular case, it's the JavaScript itself.

document.write("- "+new Date().getFullYear()); is replacing the entire page.

See this: https://stackoverflow.com/questions/19941866/document-write-overwriting-the-document

I've tested the following code in RC 2 Nightly Build in Custom Block and it works great (within global block as well).

© Copyright 2017 - 
<span id="currentYear">2017</span> Company Name – All rights reserved.
<script>
  document.getElementById("currentYear").innerHTML=new Date().getFullYear();
</script> 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@scottw12
Comment options

Answer selected by scottw12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants