回调选项在Shraepoint 2010 OpenPopUpPageWithTitle



我调用了OpenPopUpPageWithTitle方法来从一个简单的HTML按钮弹出一个新的列表项表单。它做了所有我想要的,除了回调。我试图在弹出页面关闭后从父页面调用自定义JS函数(只是一个带有一些消息的对话框)。我应该在哪里放置(或注入)自定义JS函数,以便回调可以找到它?请注意,我只有Sharepoint设计器工作。多谢。

回调函数应该在调用OpenPopUpPageWithTitle()的同一作用域中定义。

(function(){
    // do stuff
    // invoke your modal dialog
    OpenPopUpPageWithTitle("http://www.bing.com",myCallBack,500,300,"My Dialog");
    // do other stuff
    // define the call back function within the same scope:
    function myCallBack(){
        alert("Success!");
    }
})();

或者您可以使用内联匿名函数:

OpenPopUpPageWithTitle("http://www.bing.com",
    function(){
        alert("Success!");
    },500,300,"My Dialog");

最新更新