Solved

Modifying My Json Race Series Page

Posted on 2015-01-14
2
120 Views
Last Modified: 2015-01-14
Ok Padas and Big Monty spent a ton of time with me last summer developing  this page and it works awesome.  I want to extend it to school events that we time and the structure is identical except for the categories.  They are not needed.  The new page can be found here but it doesn't work.  I think I made an error in how I modified the Json call.  Here is the original one (that works):

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

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

       function getData(series, categories, gender)  {
            var url = '/series/results_array.asp?series_id=' + series + '&gender=' + gender + '&age_to=' + categories;
            if(dt) { 
                dt.fnSettings().sAjaxSource = url;
                dt.dataTable().fnDraw();
            }
            else {
                var settings = {
                    bServerSide:true, 
                    sAjaxSource:url, 
                    pagingType: "full_numbers", 
                    fnServerData: function(src, data, cb) {
                           $.post(src, data, cb, "json");
                    }
              };
              dt = $('#standings').dataTable(settings);
            }
       };       

    });
</script>

Open in new window


and here is the new one...that doesn't work:
<script type="text/javascript">
     $(document).ready(function () {
        var gender = '';
        var series = 0;

        $('#series,#gender').on('change', function () {
            gender = $('#gender').val();
            series = $('#series').val();
            getData(series, gender)
        });
 
        var dt = null;

       function getData(series, categories, gender)  {
            var url = '/series/cc_nordic/results_array.asp?series_id=' + series + '&gender=' + gender;
            if(dt) { 
                dt.fnSettings().sAjaxSource = url;
                dt.dataTable().fnDraw();
            }
            else {
                var settings = {
                    bServerSide:true, 
                    sAjaxSource:url, 
                    pagingType: "full_numbers", 
                    fnServerData: function(src, data, cb) {
                           $.post(src, data, cb, "json");
                    }
              };
              dt = $('#standings').dataTable(settings);
            }
       };       

    });
</script>

Open in new window


I just took reference to the categories out, and took the drop down for categories out.  I assume I did it incorrectly?  I have tested the page that processes the call and, from an asp standpoint, it does what it is supposed to do.  Any help would be much appreciated.
0
Comment
Question by:Bob Schneider
2 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 40549466
try removing the categories parameter in your function:

function getData(series, categories, gender)  {

should be

function getData(series, gender)  {

try that and report back, it could be as simple as removing that parameter
0
 

Author Comment

by:Bob Schneider
ID: 40549634
Dohhh!!!  THanks!!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 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

11 Experts available now in Live!

Get 1:1 Help Now