javascript - Best practice for jQuery AJAX Modals -


i have lot of jquery functions. work fine. need modal windows loaded via ajax. content loading fine too. jquery functions won't work inside modal. put javascript stuff in onloadfunction(). call on main page when loads , fire again after opening modal. jquery stuff work in modal too. every click do, jquery fires functions multiple times.

$(".something").click(function() {     alert("just alert"); }); 

this alert comes once after clicking 1 time. @ second time comes 2 times , on. ajax posts: in form validation can click 10 times on submit, after filling fields correctly , clik submit 11. time, form submited 11 times!

how can write jquery stuff , use of them in every modal , main page?


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -