Solved

Modifying My Json Race Series Page

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

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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

17 Experts available now in Live!

Get 1:1 Help Now