views:

13

answers:

1

From the following XML, I must extract the value of the uid attribute (557103888) on the fb:profile-pic element:

<li class="ui-widget-content ui-corner-tr ui-draggable">
      <fb:profile-pic height="32" width="32" linked="false" uid="557103888" style="width: 32px; height: 32px;" class=" fb_profile_pic_rendered">
          <img class="" style="width: 32px; height: 32px;" title="some name" alt="some name" src="files/t557103228_5135.jpg">
      </fb:profile-pic>
</li>

I'm using jQuery, and so far have the following code:

function deleteImage($item) {
    $item.fadeOut(function() {
    var $list = $('ul',$trash).length ? $('ul',$trash) : $('<ul class="gallery ui-helper-reset"/>').appendTo($trash);
    $item.find('a.ui-icon-trash').remove();
    $item.appendTo($list).fadeIn(function() {
     //alert($('.fb_profile_pic_rendered').attr('uid'));
    //alert("added "+ $count + " " + $item.find('img').attr('src'));
    findUserID($item.find('img').attr('src'));
    $item.animate({ width: '48px' }).find('img').animate({ height: '36px' });
    $count++;
     })
 });
}
A: 

Try this:

alert($('.fb_profile_pic_rendered').attr('uid'));
Sarfraz
I am getting value the value but I am getting infinite loop of alert.
Elankeeran
infinite loop with below code findUserID($item.find('img').attr('src'));your suggestion is working fine but I have used as below findUserID($item.find('img').attr('src'));
Elankeeran