I have a lot of jQuery functions. They work all fine. Now I need some modal windows which are loaded via Ajax. The content is loading fine too. But all jQuery functions won't work inside the modal. Now I put all my javascript stuff in a OnLoadFunction(). I call this on the main page when it loads and fire it up again after opening a modal. So the jQuery stuff work in the modal too. But with every click I do, jQuery fires the functions multiple times.
$(".something").click(function() {
alert("Just an alert");
});
This alert comes once after clicking one time. At the second time it comes two times and so on. Also all Ajax posts: in a form with validation I can click 10 times on submit, after filling all fields correctly and clik submit for the 11. time, the form get submited 11 times!
How can I write jQuery stuff and use all of them in every modal and the main page?