• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Unexpected Token Error

I am getting an "Unexpected token" for the last ")" in this script and I can't find the source of the problem.  

Here is the page I am trying to display: page with error

Note that the datatable worked well without the parameters but now I need to add the parameters (thanks to EE for this script and help learning this process)

Any help would be much appreciated.

                                  
<script type="text/javascript">
    $(document).ready(function() {
    var series = 0;
    var categories = 0;
    var gender = 'M';

    $('#series').on('change',function(){
      series = $(this).val();
      categories = $('#categories').val();
      gender = $('#gender').val();
      getData(series,categories,gender);
     });

    $('#categories').on('change',function(){
      series = $('#series').val();
      categories = $(this).val();
      gender = $('#gender').val();
     });

    $('#gender').on('change',function(){
       series = $('#series').val();
       categories = $('#categories').val();
       gender = $(this).val();
     });

      function getData(series,categories,gender){
          // for testing
        alert (series+ ' '+gender + ' '+ categories);

        $('#standings').dataTable( {
        'ajax': '/series/results_array-new.asp?series_id='+series+'&gender='+gender+'&age_to='+categories
    });
});
</script>

Open in new window

0
Bob Schneider
Asked:
Bob Schneider
1 Solution
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
you're missing the closing brace "}" in your getData function:

            function getData(series, categories, gender) {
                // for testing
                alert(series + ' ' + gender + ' ' + categories);

                $('#standings').dataTable({
                    'ajax': '/series/results_array-new.asp?series_id=' + series + '&gender=' + gender + '&age_to=' + categories
                });
            } <-- this was missing

Open in new window

0
 
Bob SchneiderAuthor Commented:
Thanks!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now