0

I am creating a page to work on low-end devices. Where JS support may not be available or very poor. So I want to hit an tag on page load for Tracking purpose.

Please help.

Rahul Bansal
  • 391
  • 3
  • 7
  • please try this one: [http://stackoverflow.com/questions/520812/how-do-i-detect-when-a-web-page-is-loaded][1] [1]: http://stackoverflow.com/questions/520812/how-do-i-detect-when-a-web-page-is-loaded – Ivin Raj Sep 10 '15 at 10:07

1 Answers1

0

please try this one:

window.whenloaded = function(fn) {
  if (window.onload) {
    var old = window.onload;
    window.onload = function() {
      old();
      fn();
    }
  } else {
    window.onload = fn;
  }
}

DEMO

Community
  • 1
  • 1
Ivin Raj
  • 3,448
  • 2
  • 28
  • 65