?
Solved

Modifying My Json Race Series Page

Posted on 2015-01-14
2
Medium Priority
?
127 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 33

Accepted Solution

by:
Big Monty earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

752 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