Calling a Token using Javascript
I'm building a page and I want it to have information from a token, which I'll pass through a URL parameter.
Example: URL is foo.com?token=Token1
What I want to happen is have the page then put in {{my.Token1}} into the HTML. The problem is that Marketo blocks the token from being created. As you can see below, I present the parameter 3 times: once with square brackets, once with curly braces and once nude. It's blocking the curlies which would create the token.
How do I get it to allow the token to happen?
Code I'm using with URL parameter "first=Link1"
<script>
document.getElementById("showParamsContainer").innerHTML =
"<p>Contact Name:<b>[[my."+getParameterByName("first") +"]]</b></p><p>This is the token: {{my."+getParameterByName("first") +"}} <b>End of line.</b><br /><br />"+getParameterByName("first") </script>
Output:
Contact Name:[[my.Link1]]
This is the token: End of line.
Link1