-
-
Save Fixxy/39410b5199acd387122c38a8a9ea247e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildURL() { | |
const hostname = window.location.hostname; | |
const pathname = window.location.pathname.slice(1); | |
const params = new URLSearchParams(window.location.search); | |
const storyID = params.get('id'); | |
return `?origin_host=${hostname}&origin_path=${encodeURIComponent(pathname)}${storyID?`&id=${storyID}`:''}`; | |
} | |
const mapFrame = document.getElementById('mapFrame'); | |
if (typeof (mapFrame) != 'undefined' && mapFrame != null) { | |
mapFrame.src = `https://maps.greenpeace.org/maps/gpint/50th_guestbook/${buildURL()}`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment