Welcome Guest, Not a member yet? Register   Sign In
[solved] jquery removing parent
#1

[eluser]SPeed_FANat1c[/eluser]
After image deletion from server I want to remove the span with this this picture, delete link and radio button. Span looks like this:

Code:
<span class="article_img">
<img src="http://localhost/darzelis/uploads/naujienos/naujiena.jpg">
&lt;input type="radio" name="image"  value="http://localhost/darzelis/uploads/naujienos/naujiena.jpg"&gt;
<a class="trinti_img" href="" id="naujiena.jpg"><img src="http://localhost/darzelis/images/admin/delete.png"></a>
</span>


Code:
$('a.trinti_img').live('click',function(){
        
        name = this.id;
        
         jConfirm('Ar tikrai norite ištrinti?', 'Patvirtinimas', function(r) {
             if(r){
                
                
                 $.post(CI.base_url + 'admin_/naujienos/delete_picture_ajax/'+name,{filename: name},  function(data) {
                    
                     if(data != 'not_admin') //this is true
                         $(this).parent().remove();
                         //console.log('test');
                    
                    });
             } //if r
         });
         return false;
     });

So the span is parent if I understand well. Where is my mistake?


Messages In This Thread
[solved] jquery removing parent - by El Forum - 12-29-2010, 11:42 AM
[solved] jquery removing parent - by El Forum - 12-29-2010, 12:24 PM
[solved] jquery removing parent - by El Forum - 12-29-2010, 03:24 PM
[solved] jquery removing parent - by El Forum - 12-30-2010, 12:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB