Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<html>
<script>
var url = new URL(window.location.href);
var data = url.searchParams.get("data");
var params = {};
data.split('&').forEach(element => {
params[element.split('=')[0]] = element.split('=')[1];
});
function doEmbedding(){
var elmWrapper = document.getElementById("contents");
var div = document.createElement("div");
div.innerText = params.testparam + " " + params.testparam2;
elmWrapper.appendChild(div);
}
</script>
<body>
<h1>This is test page</h1>
<div id="contents"></div>
</body>
<script>
doEmbedding();
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment