Solved

Modifying My Json Race Series Page

Posted on 2015-01-14
2
123 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Index on a Table 6 30
Two decimal 5 25
How to hide contact form only if no validation errors 4 20
PHP $_POST vs asp request 4 19
There is basically two types of AJAX request in mootools. Request  and Request.HTML Request: Request is the basic XHR request class in MooTools. While not extremely useful on its own, it provides the basic functionality for both Request.HTM…
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 …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

680 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