Escape your quotes or use a different quote

Escape quote
var tour-info-div =  '$(\'this\').prev(\'.tour-info-div\')' ;
var update-div       =  '$(\'this\').prev(\'.update-div\')' ;

Use double quote

var tour-info-div =  "$('this').prev('.tour-info-div')";
var update-div       =  "$('this').prev('.update-div')";

On Jan 13, 10:25 am, "Rick Faircloth" <r...@whitestonemedia.com>
wrote:
> Thanks for the reply, Brian, but that didn't solve it.
> I figured I had a case of "quotitus" :o)
>
> Here's what I have now (even took quote out of the top (this))
> and still get the same error:
>
> $(document).ready(function() {          
>
>    $('.update_button').click(function(){
>
>        var formval        = { tour_url:$(this).prev('.update_input').val(),
>                               mls_number: 
> $(this).prev('.tour-div-info').attr('id').val() };
>        var tour-info-div  = $(this).prev('.tour-info-div');
>        var update-div     = $(this).prev('.update-div');
>
>         etc...
>
> Any other ideas/suggestions?
>
> Thanks,
>
> Rick
>
> > -----Original Message-----
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
> > Behalf Of brian
> > Sent: Tuesday, January 13, 2009 12:39 PM
> > To: jquery-en@googlegroups.com
> > Subject: [jQuery] Re: What am I getting this error?
>
> > You have too many quotes in these 2 lines:
>
> > var tour-info-div =  '$('this').prev('.tour-info-div')' ;
> > var update-div       =  '$('this').prev('.update-div')' ;
>
> > try:
>
> > var tour-info-div =  $(this).prev('.tour-info-div') ;
> > var update-div       =  $(this).prev('.update-div');
>
> > On Tue, Jan 13, 2009 at 12:29 PM, Rick Faircloth
> > <r...@whitestonemedia.com> wrote:
>
> > > Hi, all...
>
> > > Why am I getting this error:
>
> > > missing ; before statement
> > > var tour-info-div = '$('this').prev('.tour-info-div')' ; \n
>
> > > from this code: ???
>
> > > $(document).ready(function() {
>
> > >   $('.update_button').click(function(){
>
> > >      var formval          =  { tour_url: 
> > > $('this').prev('.update_input').val() ,
> > >                                mls_number: 
> > > $('this').prev('.tour-div-info').attr('id').val() } ;
> > >      var tour-info-div =  '$('this').prev('.tour-info-div')' ;
> > >      var update-div       =  '$('this').prev('.update-div')' ;
>
> > >      $.ajax({     cache: false,
> > >                    type: "POST",
> > >                     url:  
> > > "../components/virtual_tours.cfc?method=update_tour&returnFormat=json",
> > >                dataType: "json",
> > >                    data: formval,
> > >                 success: function(response) {
>
> > >                          if (response.update == "Update Successful")
> > >                             { $('update-div').hide();
> > >                               $('tour-info-div').load("???").show(); }
> > >                          else
> > >                             { 
> > > $('#unsuccessful').empty().fadeIn(500).append(response.update) };
>
> > >                          }
>
> > >      });
> > >   });
> > > });

Reply via email to