Custom function error - "Not Defined"
<p>I have the following Javascript code:</p>

<pre><code>$('td:eq(2)', nRow).html('&lt;a class="critical" href="#" OnClick="toAjax(\''+aData[1]+'\', \''+aData[2]+'\');"&gt;'+aData[3]+'&lt;/a&gt;');
</code></pre>

<p>I'm getting in Firebug the following error message</p>

<blockquote>
  <p>toAjax is not defined</p>
</blockquote>

<p>My function:</p>

<pre><code>    $(document).ready(function() {

        oTable = $('.statisticsTable').dataTable({

                "bJQueryUI" : true,

                "iDisplayLength" :50,

                "sAjaxSource": 'arrays.txt',

                "aoColumns"   : [{ "bSearchable": true, "bVisible": false },null, null, null, null, null,null,null,null,null,null],

                "fnRowCallback" : function(nRow, aData, iDisplayIndex) {

                    if (aData[3] == "1") {
                        $('td:eq(2)', nRow).html('&lt;a class="critical" href="#" OnClick="toAjax(\''+aData[1]+'\', \''+aData[2]+'\');"&gt;'+aData[3]+'&lt;/a&gt;');

                        } 

                    else if

                    (aData[4] == 123) {
                        $('td:eq(3)', nRow).html( '&lt;a class="critical" href="serverID='+aData[0]+'&amp;db='+aData[1]+'&amp;task=Workload'+'"&gt;'+aData[2]+'&lt;span class="highcharts"&gt;&lt;/span&gt;&lt;/a&gt;' ).attr("class","kritikal");



                    } 

                    else if

                    (aData[3] &gt;1) {
                        $('td:eq(3)', nRow).html( '&lt;a id="ajax_call" class="critical" href="#"&gt;'+aData[3]+'&lt;span class="highcharts"&gt;&lt;/span&gt;&lt;/a&gt;' );

                        } 

                    return nRow;
                },


            } );


        function toAjax( server, db )
        {
            $.ajax({
                type: "POST",
                url: "someurl.php",
                data: "server=" + server + "&amp;db=" + db,
                success: function(msg){
                    alert( "Data Saved: " + msg );
                }
            });
        }


    }); 
</code></pre>
