[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_tourreturnFormat=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) }; } }); }); });
[jQuery] Re: What am I getting this error?
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_tourreturnFormat=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) }; } }); }); });
[jQuery] Re: What am I getting this error?
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_tourreturnFormat=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) }; } }); }); });
[jQuery] Re: What am I getting this error?
Nope...neither of those worked. I finally just gave up on creating vars from the code and used the straight code itself...no errors. Can't figure out why it wouldn't work to var them, however. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Kean Sent: Tuesday, January 13, 2009 1:51 PM To: jQuery (English) Subject: [jQuery] Re: What am I getting this error? 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_tourreturnFormat=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) }; } }); }); });