Open generated link stored as VAR in new window instead of current

Viewed 11

Below is the current working script that generates a link based in a number of the current webpage. I need the click to open the link in a new window instead of the current. I know the script is dirty but my java knowledge is limited. Thanks in advance for any assistance.

<script>
var URL = window.location;
var URLstring = String(URL);
var parsedURL = URLstring.split('=');
var cleanURL = parsedURL[1].split('#');
var courseID = cleanURL[0]
var staticURL = 'https://www.mywebpage.com/';
var sendURL = staticURL + courseID
</script>

<h3><b><span class="" style="color: rgb(51, 51, 51);">Please click</span></b></h3>
<h3><b><span class="" style="color: rgb(51, 51, 51);">the below link:</span></b></h3>
<h3><span class="" style="color: rgb(51, 51, 51);"><a href="javascript:{window.location.href = sendURL;}"><b>Click Here</b></a></span></h3>

This would send the user to https://www.mywebpage.com/0000 in the current window/tab where I need it to open a new window or tab.

0 Answers
Related