Javascript Function With JQuery POST Always Returns undefined

后端 未结 5 1642
情书的邮戳
情书的邮戳 2020-12-20 02:35

I have no idea what\'s going on here and was hoping someone could help, I\'m sure it\'s something easy going on that I\'m just missing.

I have a function in javascri

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-20 03:12

    Try this

    function GetTotalSize(callback) {    
      $.post("Handlers/GetTotal.ashx", {id : $("#hID").val()}, function(outputData) {
           callback(outputData);
        });
    }
    
    function DoSomething(data)
    {
       //....
    }
    
    GetTotalSize(DoSomething);
    

提交回复
热议问题