// Open in the same window window.location.href = externalLink; // Open in a new window window.open(externalLink);