How do I write a jquery function that accepts a callback as a parameter

后端 未结 4 1434
礼貌的吻别
礼貌的吻别 2021-01-30 03:08

I Have the following function.

function ChangeDasPanel(controllerPath, postParams) {

    $.post(controllerPath, postParams, function(returnValue) {

        $(         


        
4条回答
  •  余生分开走
    2021-01-30 03:56

    If I understand you correctly, it's as easy as setting another parameter and calling the variable as a function:

    function foo(mycallback) {
        mycallback();
    }
    

提交回复
热议问题