CINXE.COM
NHL Shop
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>NHL Shop</title> <script language="JavaScript" src="https://assets.nhle.com/projects/_lib/jquery/jquery-1.10.1.min.js" type="text/javascript"></script> <script language="JavaScript" src="shop_url_map.js" type="text/javascript"></script> <script type="text/javascript"> function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null; } jQuery( document ).ready(function() { jQuery.getJSON('https://api-web.nhle.com/v1/location', (data) => { var idParam = getURLParameter('id'); geoCountry = data.country; console.log(geoCountry); var redirectURL = ''; // check for explicit CA url for key if (geoCountry === 'CA') { redirectURL = caLinks[idParam]; if (!redirectURL) { // Canadians US map if no CA specific is found redirectURL = usLinks[idParam]; } } else if (geoCountry === 'SE') { // use Sweden redirectURL = seLinks[idParam]; } else if (geoCountry === 'FI') { // use Finland redirectURL = fiLinks[idParam]; } else if (geoCountry === 'US' || geoCountry === '') { // use US link map if in US or we can't determine your country redirectURL = usLinks[idParam]; } else { // assume international redirectURL = intlLinks[idParam]; } if(redirectURL !== undefined) { window.location.href = redirectURL; } else { jQuery('#shopLink').show(); } }); }); </script> <style type="text/css"> body { background-color: black; } img.centered { position: fixed; top: 50%; left: 50%; margin-top: -150px; margin-left: -308px; width: 250px; } </style> </head> <body> <a id="shopLink" href="https://www.nhl.com" title="NHL.com" style="display: none;"> <img src="https://cdn.nhle.com/nhl/images/logos/league/nhl_shield.png" class="centered" border="0"/> </a> </body> </html>