Howto call events after loading new html-elements by Ajax? | .live("load") .load() .on("load") ??
I have a page with dropdowns of class "
chooseObjectType " which is part of a set of form-elements.
There is also a button which loads more of those form sets.
On my dropdown,
live("change") calls the correct event and gives me "
Test 0 ".
By clicking on the button which loads more of those dropdowns (.chooseObjectType),
it does not call the onchange event as expected, so I wanted to use an "onload" event.
Deseperately none of those
Test1..3 works :(
- $(function(){
- $(".chooseObjectType").live("load", function(event)
- {
- alert("Test 1");
- });
- $(".chooseObjectType").load(function(event)
- {
- alert("Test 2");
- });
- $(".chooseObjectType").on("load", function(event)
- {
- alert("Test 3");
- });
- $(".chooseObjectType").live("change", function(event)
- {
- alert("Test 0");
- });
- });