Returning Value in JavaScript callback for jquey
<p>Sorry I could not find the appropriate title</p>

<p>Here is my problem</p>

<p>I am using a method which returns a string value like hh:mm(12:45)
this method is named as DeliveryTimeCalc()</p>

<p>I am using a jquery timepicker to take input on my aspx page
this timepicker has to be validated by mintime
the minimum time should be the value returned by the method DeliveryTimeCalc()
this serverside method has to be called during the jquery is initialized 
so i did the below method</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
        //window.onload = pageMethodConcept.callServerSideMethod;
        var time = pageMethodConcept.callServerSideMethod;
        alert(time);
        var hm = time.split(':');
        var h = hm[0]; var m = hm[1];
        $("#tb_DeliveryTime").timepicker({ showPeriodLabels: false,
            onHourShow: OnHourShowCallback,
            onMinuteShow: OnMinuteShowCallback
        });
        function OnHourShowCallback(hour) {

            if ((hour &lt; h)) {
                return false; // not valid
            }
            return true; // valid
        }
        function OnMinuteShowCallback(hour, minute) {
            if ((hour == h) &amp;&amp; (minute &lt;= m)) { return false; } // not valid
            return true;  // valid
        }
    });
&lt;/script&gt;
&lt;script language="javascript" type="text/javascript"&gt;
pageMethodConcept = {
    callServerSideMethod: function () {
         PageMethods.DeliveryTimeCalc(pageMethodConcept.callback);
    },
    callback: function (result) {
        alert(result);
        //return result;
        }
    }
    //window.onload = pageMethodConcept.callServerSideMethod;
&lt;/script&gt;
</code></pre>

<p>but the problem is that it is not returning the value (hh:mm)
i am getting a alert box which contains output like </p>

<pre><code>function () {
         PageMethods.DeliveryTimeCalc(pageMethodConcept.callback);
    }
</code></pre>

<p>even if i use return i am getting the same value</p>

<p>but if i use</p>

<pre><code>window.onload = pageMethodConcept.callServerSideMethod;
</code></pre>

<p>i am getting a alert box which contains output like hh:mm</p>

<p>Please Help!</p>
