Thanks for the answer as well as the reference, Karl.

Rick

> -----Original Message-----
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
> Behalf Of Karl Rudd
> Sent: Tuesday, January 13, 2009 10:35 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: In this code, what would $(this) in the success part 
> refer to?
> 
> 
> If you check the documentation you'll see that "this" in the "success"
> function will be "the options for this ajax request".
> 
> http://docs.jquery.com/Ajax/jQuery.ajax#options
> 
> Karl Rudd
> 
> On Wed, Jan 14, 2009 at 2:31 PM, Rick Faircloth
> <r...@whitestonemedia.com> wrote:
> >
> > Would it still be referring to the '.update-button that was clicked in the 
> > second line?
> >
> > Thanks,
> >
> > Rick
> >
> >
> > $(document).ready(function() {
> >
> >   $('.update-button').click(function(){
> >
> >      var formval   =   { tour_url:   
> > $(this).parent().parent().find('.update-input').attr('value'),
> >                          mls_number: 
> > $(this).parent().parent().parent().attr('id'),
> >                          dsn:        
> > '<cfoutput>#application.dsn#</cfoutput>',
> >                          agent_id:   
> > '<cfoutput>#session.agent_id#</cfoutput>' };
> >
> >                          $.ajax({    cache: false,
> >                                      type: "POST",
> >                                      url:
> > "../components/virtual_tours.cfc?method=update_tour_url&returnFormat=json",
> >                                      dataType: "json",
> >                                      data: formval,
> >                                      success: function(response) {
> >
> >                                         if (response.update == "Update 
> > Successful")
> >                                               { $(this).attr('id');
> >                                                 $(this).attr('id'); }
> >                                         else
> >                                               {
> > $(this).parent().next('.tour-url').empty().append('Update 
> > Unsuccessful').fadeIn(500); }
> >
> >                                      }
> >
> >
> >                          });
> >   });
> >
> > });
> >
> >

Reply via email to