Ir para conteúdo
Fórum Script Brasil
  • 0

Ajuda Em Java Script Por Favor!


xamonix

Pergunta

Olá amigos tenho este código em java que me redirecciona a pagina consoante a linguagem do browser seja ou não portuguesa. O redireccionamento é instantaneo mas eu queria atrasá-lo uns 2 ou 3 segundos. Como faço? Escusado será dizer que sou um ignorante nestas coisa de programção , o código foi sacado doutro site (mas ainda sei fazer copy/paste...lol). Obrigado pela ajuda!

<script LANGUAGE="JavaScript1.2">
<!-- Begin
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;

/*-------------------------------------------------------------
Netscape instructions:
In Netscape, find the language you want to redirect by going to

Edit Menu --> Preferences...

Then click the '+' box next to 'Navigator' and click 'Languages'
Click 'Add' then find the languages you want and add them below.

---------------------------------------------------------------

Microsoft Internet Explorer instructions:
In MSIE, find the language you want to redirect by going to

Tools Menu --> Internet Options...

Then click the 'Languages' button near the bottom of the page.
Click 'Add' then find the languages you want and add them below.

-------------------------------------------------------------*/
if (language.indexOf('en') > -1) document.location.href = 'english.htm';
else if (language.indexOf('nl') > -1) document.location.href = 'english.htm';
else if (language.indexOf('fr') > -1) document.location.href = 'english.htm';
else if (language.indexOf('de') > -1) document.location.href = 'english.htm';
else if (language.indexOf('já') > -1) document.location.href = 'english.htm';
else if (language.indexOf('it') > -1) document.location.href = 'english.htm';
else if (language.indexOf('pt') > -1) document.location.href = 'portugues.htm';
else if (language.indexOf('es') > -1) document.location.href = 'english.htm';
else if (language.indexOf('sv') > -1) document.location.href = 'english.htm';
else if (language.indexOf('zh') > -1) document.location.href = 'english.htm';
else if (language.indexOf('ru') > -1) document.location.href = 'english.htm';
else
document.location.href = 'portugues.htm';
// End -->
</script>

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152k
    • Posts
      651,8k
×
×
  • Criar Novo...