Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Скрипт переадресовывает, если у браузера пользователя нет поддержки Flash:location="http://www.site.com";
document.location.href="http://www.site.com";
window.location.reload("http://www.site.com");
document.location.replace("http://www.site.com");
<SCRIPT language="JavaScript">
var reqVer = 5;
var goFlash = 'intro.htm'
var goNoFlash = 'noflash.htm'
var goUpgrade = 'noflash.htm'
var isInst2 = 0;
var isInst3 = 0;
var isInst4 = 0;
var isInst5 = 0;
var maxVer = 5;
var curUserVer = 0;
var goodVer = 0;
var jsVer = 1.0;
var isIE = (navigator.appVersion.indexOf('MSIE') != -1) ? 1 : 0;
var isWin = (navigator.appVersion.indexOf('Windows') != -1) ? 1 : 0;
jsVer = 1.1;
if(isIE && isWin){
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
document.write('on error resume next \n');
document.write('isInst2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
document.write('isInst3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
document.write('isInst4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
document.write('isInst5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
document.write('</SCR' + 'IPT\> \n');
}
function getFlash(){
if (navigator.plugins){
if (navigator.plugins['Shockwave Flash 2.0'] || navigator.plugins['Shockwave Flash']){
var isVer2 = navigator.plugins['Shockwave Flash 2.0'] ? ' 2.0' : '';
var fDesc = navigator.plugins['Shockwave Flash' + isVer2].description;
var fVer = parseInt(fDesc.charAt(fDesc.indexOf('.') - 1));
isInst2 = fVer == 2;
isInst3 = fVer == 3;
isInst4 = fVer == 4;
isInst5 = fVer == 5;
}
}
for (var i = 2; i <= maxVer; i++) {
if (eval('isInst' + i) == 1) curUserVer = i;
}
if(navigator.userAgent.indexOf('WebTV') != -1) curUserVer = 2;
if (curUserVer >= reqVer) {
goodVer = 1;
if(jsVer > 1.0) {
window.location.replace(goFlash);
} else {
window.location = goFlash;
}
} else {
if(jsVer > 1.0) {
window.location.replace((curUserVer >= 2) ? goUpgrade : goNoFlash);
} else {
window.location = (curUserVer >= 2) ? goUpgrade : goNoFlash;
}
}
}
getFlash();
</SCRIPT>
function coolRedirect(url, msg)
{
var TARG_ID = "COOL_REDIRECT";
var DEF_MSG = "Redirecting...";
if( ! msg )
{
msg = DEF_MSG;
}
if( ! url )
{
throw new Error('You didn\'t include the "url" parameter');
}
var e = document.getElementById(TARG_ID);
if( ! e )
{
throw new Error('"COOL_REDIRECT" element id not found');
}
var cTicks = parseInt(e.innerHTML);
var timer = setInterval(function()
{
if( cTicks )
{
e.innerHTML = --cTicks;
}
else
{
clearInterval(timer);
document.body.innerHTML = msg;
location = url;
}
}, 1000);
}