核心提示: function closeWin() { window.parent.ymPrompt.doHandler('error',true); } 或者直接写在链接里:关闭窗口

网上才找到解决方法:

function closeWin() 

window.parent.ymPrompt.doHandler('error',true); 
}

或者直接写在链接里:<a href="#" onclick="window.parent.ymPrompt.doHandler('error',true)">关闭窗口</a>

这样当子窗口的按钮触发closeWin时,将"error"值传回给父窗口的回调函数的参数tp,true参数就是自动关闭子窗口。

(方法来源:http://www.fengfly.com/plus/view-184093-1.html,在此表示深深的谢意!)

原来,官方的说明“close():关闭当前弹出的窗口 如:ymPrompt.close()”都不对呀,不能直接这样调用。

没有登录不能评论