Load javascript with random query param

For now, I am just getting this logged somewhere I can find it later:

Code:
<script>
  var el = document.createElement( “script” );
  el.setAttribute( “type”, “text/javascript” );
  el.setAttribute( “src”, “time.php?rand=”+bigRandomString);
  document.getElementsByTagName( “head” )[ 0 ].appendChild( el );

  function receiveTime(minLeft)
  {
     // Do whatever
  }
</script>

time.php:

<?php

$minleft = “whatever”;
print “receiveTime($minleft);”
exit;

?>

This entry was posted in Code. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree