How can I send an event to my window? For example, in my code, I have:
$("#info").click(function(){ // do stuff });
I need to call this function for the first time, without clicking on #info, in how // to do things.
You can use the method .trigger():
.trigger()
$('#info').trigger('click');
or simply:
$('#info').click();
which would be the same.
The best method would be to create a function that does the desired material and then $(document).ready(myFunc);and $("#info").click(myFunc);.
$(document).ready(myFunc);
$("#info").click(myFunc);