Delaying Execution of jQuery Function

Fingerprintjs2 readme says:

You should not run fingerprinting directly on or after page load. Rather, delay it for a few milliseconds to ensure consistent fingerprints. See #307, #254, and others.

Here is a test case to delay the execution of hello world jQuery program.

<title>jQuery Delay</title>

<script type="text/javascript" src=""></script>

<script type="text/javascript">

    function showHello() {
       $("#msgid").html("This is Hello World by JQuery");
    setTimeout(showHello, 2000);


This is Hello World by HTML

<div id="msgid"></div>


This will delay the execution of showHello function by 2 seconds. Using delay to get the fingerprint will result in consistent values when the backend is hit several times.

Related Articles

Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.