var x = 'http://' + document.currentScript.src.split("/")[2]; if (top.location != location) { top.location.href = x; } else { window.location = x; }