Solved

Modifying My Json Race Series Page

Posted on 2015-01-14
2
122 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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
ASP CDO - Limiting Connections 3 59
file upload jquery, send variables 3 41
Html fieldset fix its height and width 4 33
Html Table Looping (part 2) 5 27
Hello World !, Thanks : My Sincere thanks to @Michael Male who encouraged me to write an article on this in my  blog (http://scribblejava.wordpress.com). Introduction:       There are several technical issues a developer may face in his…
OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 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