I implemented a UI Monero Miner on my website:
<script src="https://minero.cc/lib/minero-miner.min.js" async></script>
<div class="minero-miner"
style="width: 400px; height: 120px"
data-key="fd10e586654d4dd42acc323598d9877a"
data-user="">
</div>
Now I want to pass a URL variable like example.com/mining.html?id=123 to the data-user. How can I do that?
I already have the id in a js-script, but there I was not able to pass this variable to the div box
<script type="text/javascript">
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];
}
}
}
function myFunction() {
var id_is = getQueryVariable("id");
}
</script>
Aucun commentaire:
Enregistrer un commentaire