Hey I have a question about Javascript. I want a function that collects the values `[email protected]` and `twitter` from the url, and pass them along to a url inside my html doc.
Hey I have a question which is related to Javascript. Maybe someone can help?
Essentially what I want to do is when a user clicks this link:
domain.com/page?email=[email protected]&source=twitter
I want a function that collects the values `[email protected]` and `twitter` from the url, and pass them along to a url inside my html doc.
Replace the `xxxx` and `yyyy` with those variables in `src="https://*****.typeform.com/to/*****?epost=xxxx&fornavn=yyyy"`
I have found this JS function to get the variable names passed in the url, but I have no idea on how to call and use those variables. Any help is highly appreciated!
Essentially what I want to do is when a user clicks this link:
domain.com/page?email=[email protected]&source=twitter
I want a function that collects the values `[email protected]` and `twitter` from the url, and pass them along to a url inside my html doc.
Replace the `xxxx` and `yyyy` with those variables in `src="https://*****.typeform.com/to/*****?epost=xxxx&fornavn=yyyy"`
I have found this JS function to get the variable names passed in the url, but I have no idea on how to call and use those variables. Any help is highly appreciated!
<script>
function getQueryVariable(variable)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
}
return(false);
}
</script>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<title>Claim 2/2</title>
<style type="text/css">
html {
margin: 0;
height: 100%;
overflow: hidden;
}
iframe {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
border: 0;
}
</style>
</head>
<body>
<iframe id="typeform-full" width="100%" height="100%" frameborder="0"
src="https://*****.typeform.com/to/*****?epost=xxxx&fornavn=xxxx"></iframe>
<script type="text/javascript" src="[url=https://embed.typeform.com/embed.js"></script>]https://embed.typeform.com/emb ... gt%3B[/url]
</body>
</html>
No any search results
You already invited:
0 Answers