jQuery(document).ready(function(){ var url = "https://nms.kcl.ac.uk/core/wp-content/plugins/trafficanalyzer/js/ta_post_loaded.php?hid=9e06ac4098121d946caf4e2477df9ad1"; var xhr = new XMLHttpRequest(); xhr.open("get",url,"true"); xhr.send(); } ); window.onload = function(){ /* var url = "https://nms.kcl.ac.uk/core/wp-content/plugins/trafficanalyzer/js/ta_post_loaded.php?hid=9e06ac4098121d946caf4e2477df9ad1"; var xhr = new XMLHttpRequest(); xhr.open("get",url,"true"); xhr.send(); */ }