Unexpected Token Error

Posted on 2014-09-16
Last Modified: 2014-09-16
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 = $(this).val();
      categories = $('#categories').val();
      gender = $('#gender').val();

      series = $('#series').val();
      categories = $(this).val();
      gender = $('#gender').val();

       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

Open in new window

Question by:Bob Schneider
    LVL 32

    Accepted Solution

    you're missing the closing brace "}" in your getData function:

                function getData(series, categories, gender) {
                    // for testing
                    alert(series + ' ' + gender + ' ' + categories);
                        'ajax': '/series/results_array-new.asp?series_id=' + series + '&gender=' + gender + '&age_to=' + categories
                } <-- this was missing

    Open in new window


    Author Closing Comment

    by:Bob Schneider

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
    JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now