Visualizzazione dei risultati da 1 a 3 su 3

Discussione: info su detect browers

  1. #1
    Utente di HTML.it L'avatar di andy_s
    Registrato dal
    Apr 2000
    Messaggi
    345

    info su detect browers

    ciao
    ho questo codice...però dovrei modificarlo
    -------------
    <script language="JavaScript1.2">
    if (navigator.appName=="Netscape"){
    // Stile per Netscape
    document.write("<LINK REL=STYLESHEET TYPE='text/css' HREF='/css/wind_net.css'>")
    }else{
    // Stile per Explorer
    document.write("<LINK REL=STYLESHEET TYPE='text/css' HREF='/css/wind.css'>")
    }
    </script>
    ---------------
    quello che dovrebbe fare è sapere se si sta usando IE7 e quindi carica pagina y
    se non è quello invece carica pagina x

    come si fa?

    ciao

  2. #2
    Utente di HTML.it L'avatar di oronze
    Registrato dal
    Jun 2001
    Messaggi
    3,543
    trovato con google, adattalo tu
    Codice PHP:
    <SCRIPT language="javascript">
        
    <!--    
    //test
    //DO NOT REMOVE
    //alert("Yowser!");

        
    var bName navigator.appName;
    var 
    bVer integer(navigator.appVersion);
    var 
    ver;
    //DO NOT CHANGE ANYTHING BELOW THIS POINT
    function browserCheck() {    

    if (
    bName == "Netscape" && bVer == 1ver "n1";
        
    else if (
    bName == "Netscape" && bVer == 2ver "n2";
        
    else if (
    bName == "Netscape" && bVer == 3ver "n3";
        
    else if (
    bName == "Netscape" && bVer == 4ver "n4";
        
    else if (
    bName == "Netscape" && bVer == 5ver "n5";
        
    else if (
    bName == "Netscape" && bVer == 6ver "n6";
        
    else if (
    bName == "Microsoft Internet Explorer" && bVer == 1ver "ie1";
        
    else if (
    bName == "Microsoft Internet Explorer" && bVer == 2ver "ie2";
        
    else if (
    bName == "Microsoft Internet Explorer" && bVer == 3ver "ie3";
        
    else if (
    bName == "Microsoft Internet Explorer" && bVer == 4ver "ie4";
        
    else if (
    bName == "Microsoft Internet Explorer" && bVer == 5ver "ie5";
        
    else if (
    bName == "Microsoft Internet Explorer" && bVer == 6ver "ie6";
        
    else if (
    bName == "Microsoft Internet Explorer" && bVer == 7ver "ie7";
        
    if (
    ver == "ie5" || "ie6" || "ie7" || "n4" || "n5" || "n6") {
        
    //you may put wut ever you want within the quotes

        
    alert("Knock Knock!");
        
    alert("Who's There?");                
        
    alert("Awelocome!");
        
    alert("Awelocome who?");
        
    alert("Awelocome to the Jokes and Riddles section!");
        
    }

    else if (
    ver == "ie4" || "ie3" || "ie2" || "ie1" || "n3" || "n2" || "n1") {
        
    //put wut you want to tell the user if their browser version is'nt high enough
        
    alert("It is strongly advised that you upgrade your browser.");
        
    }        
    }    
        
                                
        
        
    //-->    
        
    </SCRIPT> 

    No ai layout tabellari!

    Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872

  3. #3
    Utente di HTML.it L'avatar di andy_s
    Registrato dal
    Apr 2000
    Messaggi
    345
    ho provato a copiarlo pari pari
    mi da errore in questa riga
    -----------
    var bVer = integer(navigator.appVersion);
    ------------

    ps. forse mi sopravaluti :mame

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.