Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Trying to use data()
  2. $('.solicitud_amistad').click(function(){
  3.     var aux =  $(this);
  4.     console.log($(this));
  5.     console.log($(this).data('receptor'));
  6.     $.post('amistad/nueva' , {id_receptor:$(this).data('receptor')},
  7.         function(response){
  8.             aux.replaceWith(response)
  9.         }
  10.     );
  11. });
  12.        
  13. <a class="solicitud_amistad" data-receptor="4">Enviar solicitud de amistad</a>
  14. undefined
  15.        
  16. jQuery.data(this, 'receptor');