2009-10-07

Window redirect and close

This was the window that was opened from CRM form menu (ISV.Config.xml). The window has received some parameters and then redirected to another window, which is preparing and opening the MS Word document, but the pop-up window was still open - this is rude. So, I've closed it.

// call this code on body onload event
function redirect()
{
    // needed URL of pop-up window or modify current location URL
    window.opener.location = window.location.href.replace(/Default2/, "Default");
    window.top.close();
}

Комментариев нет: