ajax filter tag from controller call and fadeout with remove children tagcall | |
---|---|
Subject: | |
another long process to add a filtered element from the controller echo with ajax request, then fade out success response and have to remove the new inserted tag with attributes so you can cycle this function several times. | |
2014-12-07 13:33:29 | gstlouis |
success: function(data){ /*$('.successSaved').css({ $('.successSaved').fadeOut('slow'); setTimeout(function(){ | gstlouis |
2014-12-07 13:33:49 | |
The above works fine when you filter top level tags. If you need to select children or descending tags you use find() references: If you want to select the top-level elements = elements that are direct children of BODY - in this example: #wrap or #tooltip - then you have to use filter(). If you want to select other elements - in this example: #header, h1, #body, ... - then you have to use find(). I you don't know whether your element is a child of BODY or not, you could use this "hack": $("<div>").html(data).find( selector ); By using this work-around, you always get the elements via find(). | gstlouis |
2015-02-25 22:21:44 | |