Skip to content

Instantly share code, notes, and snippets.

@ryancdotorg
Created September 16, 2022 22:42
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save ryancdotorg/3ea628f026a19fbc1a210b7841b9c486 to your computer and use it in GitHub Desktop.
//<!--{}/*
`*/
html{color:blue}
body{font-size:300%}
#main::after{content:" & style applied"}
/*`;
(function(){
var p = document.querySelector("#main");
p.textContent = "script executed";
})();
/*-->
<!DOCTYPE html>
<html><head><title>polyglot</title><style>
html{visibility:hidden;line-height:0}
.visible{visibility:visible;line-height:normal}
</style></head><body><div class="visible">
<div id="main">html loaded</div>
</div>
<script>
setTimeout(function(){
var s = document.createElement('link');
s.rel = 'stylesheet';
s.href = location.href;
document.body.appendChild(s);
s = document.createElement('script');
s.src = location.href;
document.body.appendChild(s);
}, 1000);
</script>
</body></html>
<!--*///-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment