function getNewSchedule(response.MONTH, response.YEAR) {

the parameteres when you declare a function are variable names, and
those are invalid. Try

 function getNewSchedule(month, year) {

and replace the response.XX references inside the function
accordingly. You can then call the function passing those object
properties: getNewSchedule(response.MONTH, response.YEAR) and access
their values inside the function with the 'month' and 'year'
variables.

cheers,
- ricardo

On Feb 14, 1:19 am, "Rick Faircloth" <r...@whitestonemedia.com> wrote:
> Good call, James...couldn't see that one...I've been starting at it too long!
>
> How about another one?
>
> Here's the error message:
>
> "missing ) after formal parameters"
> "function getNewSchedule(response.MONTH, response.YEAR) {\n"
>
> And here's the code...ideas?  Thanks!
>
> <script>
>
>      function getNewSchedule(response.MONTH, response.YEAR) {
>
>           var formval  =  { dsn:       
> '<cfoutput>#application.dsn#</cfoutput>',
>                             month:     response.MONTH,
>                             day:       '01',
>                             year:      response.YEAR };
>
>                             console.log(formval);
>
>           $.ajax         ({ cache:     false,
>                             type:      "post",
>                             url:
> "../components/floor_duty.cfc?method=get_new_schedule&returnFormat=json",
>                             dataType:  "json",
>                             data:      formval,
>                             success:   function(response) {
>
>                                             if  (response.MESSAGE == 
> 'Success')
>                                                 { 
> $('#li-none:visible').hide();
>                                                 
> $('#schedule-month-year').empty().append('Below is
> the schedule for' + response.MONTH +' '+ response.YEAR);
>                                                 
> $('#schedule-instructions').fadeIn(500);
>                                                 
> $('#scheduleBody').fadeIn(500);
>
>                                                 populateDutyTable(response); }
>
>                                           else
>                                                 { 
> $('#li-below:visible').hide();
>                                                   
> $('#none-date').empty().append(response.MONTH +'
> '+ response.YEAR);
>                                                   $('#li-none').fadeIn(500);
>                                                   
> $('#scheduleBody').fadeOut(250); }
>
>                                        }
>           });
>      }
>
> </script>
>
>
>
> > -----Original Message-----
> > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
> > Behalf Of James
> > Sent: Friday, February 13, 2009 9:11 PM
> > To: jQuery (English)
> > Subject: [jQuery] Re: Would some please tell me what's wrong with this 
> > syntax?
>
> > The word 'function' is not suppose to be there. It's there only when
> > you define a function, not when you call it.
>
> > On Feb 13, 4:07 pm, "Rick Faircloth" <r...@whitestonemedia.com> wrote:
> > > Hi, James, and thanks for the reply...
>
> > > I've got a page full of code and two other errors
> > > that are *seemingly* unrelated, however, anything is possible.
>
> > > Let me ask this in relation to the second error message:
>
> > > See anything wrong with this syntax (reponse section of an ajax function):
>
> > > success:   function(response) {
>
> > >            if (response.RESULT == 'Success')
>
> > >               { $('#li-month-year-inst').fadeOut(250);
> > >                 $('#li-month-year').fadeOut(250);
> > >                 $('#li-new-schedule-message').empty().append('Here is the 
> > > new schedule for '+
> > > response.MONTH + response.YEAR).hide().fadeIn(500);
>
> > >                 function getNewSchedule(response.MONTH, response.YEAR); }
>
> > >            else
> > >               {
> > >                 $('#li-new-schedule-message').empty().append('An error 
> > > occured.  Please click
> the
> > > create link to try again.').hide().fadeIn(500);
> > >               }
>
> > > }
>
> > > I'm getting this error message for the "function getNewSchedule..." line 
> > > in the middle:
>
> > > "missing ) after formal parameters"
> > > "function getNewSchedule(response.MONTH, response.YEAR);\n"
>
> > > Ideas?
>
> > > Thanks,
>
> > > Rick
>
> > > > -----Original Message-----
> > > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
> > > > Behalf Of James
> > > > Sent: Friday, February 13, 2009 8:50 PM
> > > > To: jQuery (English)
> > > > Subject: [jQuery] Re: Would some please tell me what's wrong with this 
> > > > syntax?
>
> > > > I don't see the problem. Do you have more code than this somewhere
> > > > that could be causing the error?
>
> > > > On Feb 13, 3:16 pm, "Rick Faircloth" <r...@whitestonemedia.com> wrote:
> > > > > Thanks for the reply...the paren before the second function definitely
> > > > > shouldn't have been there...
>
> > > > > Now, with this:
>
> > > > > <script>
>
> > > > > $(document).ready(function() {
>
> > > > >      $('.cancel').livequery('click', function() {
>
> > > > >           $(this).parent().parent().find('.select-div').hide();
> > > > >           $(this).parent().hide();
> > > > >           $(this).parent().parent().find('.last-name').fadeIn(500);
> > > > >           $(this).parent().parent().find('.first-name').fadeIn(500);
> > > > >           $(this).parent().parent().find('.change-div').fadeIn(500);
> > > > >           return false;
>
> > > > >      });
>
> > > > > });
>
> > > > > </script>
>
> > > > > I get:
>
> > > > > "missing } in XML expression"
> > > > > "}); \n" <--- the brace and parenthesis refers to the first pair in 
> > > > > the code above
>
> > > > > Again, I've tried every variation...what am I doing wrong?
>
> > > > > Thanks,
>
> > > > > Rick
>
> > > > > > -----Original Message-----
> > > > > > From: jquery-en@googlegroups.com 
> > > > > > [mailto:jquery...@googlegroups.com] On Behalf Of donb
> > > > > > Sent: Friday, February 13, 2009 7:49 PM
> > > > > > To: jQuery (English)
> > > > > > Subject: [jQuery] Re: Would some please tell me what's wrong with 
> > > > > > this syntax?
>
> > > > > > The '()' around the 'click' function doesn't belong there.
>
> > > > > > On Feb 13, 7:38 pm, "Rick Faircloth" <r...@whitestonemedia.com> 
> > > > > > wrote:
> > > > > > > I'm getting this error:
>
> > > > > > > "missing ) after argument list"
> > > > > > >      "return false;\n"
>
> > > > > > > from this code:
>
> > > > > > > $(document).ready(function() {
>
> > > > > > >      $('.cancel').livequery('click', (function() {
>
> > > > > > >           $(this).parent().parent().find('.select-div').hide();
> > > > > > >           $(this).parent().hide();
> > > > > > >           
> > > > > > > $(this).parent().parent().find('.last-name').fadeIn(500);
> > > > > > >           
> > > > > > > $(this).parent().parent().find('.first-name').fadeIn(500);
> > > > > > >           
> > > > > > > $(this).parent().parent().find('.change-div').fadeIn(500);
>
> > > > > > >      })
> > > > > > >      return false;
> > > > > > >      );
>
> > > > > > > });
>
> > > > > > > I've tried every variation I can think of and can't get rid of 
> > > > > > > the error...
>
> > > > > > > Thanks,
>
> > > > > > > Rick

Reply via email to