Client script code to redirect to an external link in a new window in predefined width on a button action.

const handleButtonClick = () => {
            try {
                let redirectUrl = "sample_url";
                let width = 1300;
                let height = 700;
                let left = (screen.width - width) / 2;
                let top = (screen.height - height) / 2;
                window.open(redirectUrl, '_blank', `location=yes,height=${height},width=${width},scrollbars=yes,status=yes,left=${left},top=${top}`);
            } catch (err) {
                console.error("error@handleButtonClick", err);
            }
        }

Leave a comment

Your email address will not be published. Required fields are marked *