Basically what I want to do is to be able to detect when the particular page loads in some data dynamically.

This needs to be general as the script will run across a lot of websites whose js content or other content/configuration I am unaware of. My intention is that everytime something new is loaded onto the page it is picked up within my code so I can execute some other code as a result.

For instance, in an ideal world the following code/similar would exist;

    alert('my code here gets executed!');

I have not been able to find something like it and need it badly. One particular solution was to simply execute the code every 10 seconds or so (in hope new data may have been loaded in) but this is highly inefficient as it hogs the resources of the browser for about one second or so when my code analyses the page each time. It would be ideal if the analysis was only done at an appropriate point (when new data is loaded in).

Any ideas guys.

3 Years
Discussion Span
Last Post by asif49

Also, the code needs to run successfully on IE, Chrome and Firefox.


I don't know any way of automatically picking up on any AJAX request that happens on a page by dropping in a function. If I thought long and hard I might think of a way. But, why not just add a call to your function in the AJAX request on "complete"?


Please note that the script will be run on a plethora of different websites that are coded by different developers. So the pages this will run on, their content/code will be unknown.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.