e.data syntax problem

e.data syntax problem


it’s always me with those e.data syntax problems :-)

I am trying and searching in the web for weeks now, but I cannot find a solution which in my eyes got to be very very simple.

I currently use e.data in situations where I bind it like:

 $(window).on('resize', {zoom:2.4}, size_element);

function size_element(e)
alert (e.data.zoom);

So far, so good. Always works fine.

But what if I wished to pass e.data in a situation as:

function example(){



I mean generally situations where I do not have something like 'click' or 'resize' or whatever as part of the syntax.

This must be possible!

But how???

I mean in the second case (to explain myself better) I could always do something stupid as:

$(document).ready(function() {

and it works! But come on…I know this isn’t the right way.

Please help me in this simple question that is crucial for many of my codes.
I cannot find anything about it!

Thank you in advance