Reputation: 3
First of all, so everyone here can undestand, I have a script to get the parameter:
<script>
function getURLParameter(name) {
return decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] || ''
);
}
</script>
This script add the parameter:
<script>document.write(getURLParameter('code'))</script>
I need to implement the script above, here:
<script>
document.getElementById('destiny').innerHTML = Destination.linkHtml('https://myurl.php?code=PARAMETER');
</script>
Upvotes: 0
Views: 52
Reputation: 179
If you just need to append the result of getURLParameter('code') to your query string, you could use:
<script>
var parameter = getURLParameter('code');
document.getElementById('destiny').innerHTML = Destination.linkHtml('https://myurl.php?code=' + parameter );
</script>
Upvotes: 1