Get a Javascript variable outside the script

Using dmx.parse(‘myVariable.setValue(“vuFp”)’) works, but sets the value to “vuFp” and not the actual variable value

If var_test is the variable in your JS script, then, you replace “vuFp” with your variable like this

console.log(var_test);
dmx.parse(‘myVariable.setValue(’ + var_test + ‘)’);

console.log will print the value of the variable in your console, check if that’s what you want to assign to myVariable

@salvuccicarlos, edited above

1 Like
<script>
  var vuFp = new VUBrowserFP();

  vuFp.getFingerprintInfo(function(info) {
    dmx.global.set('bfp', info.fingerprint);
  });

  vuFp.getFingerprintInfoWithSeed(function(info) {
    dmx.global.set('bfpSeed', info.fingerprint);
  });
</script>

access it directly with {{ bfp }} and {{ bfpSeed }}.

1 Like

Sorry for the delay. Thanks! It worked. I’m very grateful!