JQuery method .on() with load event

JQuery method .on() with load event

Hello!

I'm stuck with the .on method and I'm hopping one of you can give me an advice how to do it.

That's what I have so far, but unfortunately it's not working.

  1.  $('#content').on('load', '.something', function() {
  2.       console.log("never reached");
  3.       // some ajax stuff goes here
  4. });

I wanna load some ajax stuff after the page is ready. Ok, so far there is no need for the .on() method. I could realize it also without.

The problem is that if I replace my content by loading the next page over ajax, the selector won't work. That's why i wanna use the .on() method. But how? It seems like the first argument "load" is the problem, if I replace it with mousenter or click it would work. But that's not how I want it. It needs to be loaded after the page is ready.


Thx in advance