Skip to content

Instantly share code, notes, and snippets.

View 5ervant's full-sized avatar
🏠
Working from home

5ervant | techintel.github.io 5ervant

🏠
Working from home
View GitHub Profile
@5ervant
5ervant / head.html
Created February 16, 2019 15:52 — forked from krschmidt/head.html
Set Canonical URL via Javascript
<script type='text/javascript'>
var link = document.createElement('link');
link.setAttribute('rel', 'canonical');
link.setAttribute('href', location.protocol + '//' + location.host + location.pathname);
document.head.appendChild(link);
</script>