(function() { var url = window.location.href; var sn = ""; if (url.indexOf("sn=") !== -1) { sn = url.split("sn=")[1].split("&")[0]; } if (sn) { document.getElementById("sn-code").textContent = "SN: " + sn; } })();