L'objet navigator...

L'objet navigator... - HTML/CSS - Programmation

Marsh Posté le 03-06-2005 à 13:23:58    

Je voulais afficher une image, avec un lien Si le client n'a pas firefox comme navigateur... :whistle: Le truc c'est que sa marche pas... :hurle:
sa donne :
 
<SCRIPT language="Javascript">
var Nom = navigator.appName;
if (var Nom != 'Netscape') {
document.write(<p align="center"><a href="http://www.mozilla-europe.org/fr/products/firefox/"><img src="getfirefox.png"></a></p> )
};
</script>
 
(Ma page est en *.php)
 
Merci de m'aider

Reply

Marsh Posté le 03-06-2005 à 13:23:58   

Reply

Marsh Posté le 03-06-2005 à 13:35:47    

nicolasdu83 a écrit :

Je voulais afficher une image, avec un lien Si le client n'a pas firefox comme navigateur... :whistle: Le truc c'est que sa marche pas... :hurle:
sa donne :


C'est stupide, il existe de très bon navigateurs qui ne sont pas Firefox [:spamafote]  

Citation :


<SCRIPT language="Javascript">
var Nom = navigator.appName;
if (var Nom != 'Netscape') {
document.write(<p align="center"><a href="http://www.mozilla-europe.org/fr/products/firefox/"><img src="getfirefox.png"></a></p> )
};
</script>


Et ta méthode de test est naze.
 
Si tu veux inciter les utilisateurs de MS Internet Explorer, le plus simple est d'utiliser les "conditional comments" mis à ta disposition par les gens de chez Microsoft et qui permettent de fournir un contenu spécifiquement à MSIE.
 
Et si tu es très très fort, tu peux tenter le Malarkey Style
(regarder la page sous !IE, Safari, Opera, FF, ... puis sous MSIE)


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 03-06-2005 à 14:26:36    

simple je pense :  
dans ton code HTML
 
<p id="ImageFireFox"><a href="http://www.mozilla-europe.org/fr/products/firefox/"><img src="getfirefox.png"></a></p>
 
dans ta CSS
 
#ImageFireFox {
  display:none !important;
  _display:inline;
}

Reply

Marsh Posté le 03-06-2005 à 14:27:35    

un <p> ça a un display block par défaut, pas inline [:aloy]


---------------
I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box, and replicate and expand beyond their wildest dreams by throwing away the limits imposed by overbearing genetic r
Reply

Marsh Posté le 03-06-2005 à 15:02:29    

ouais jvoulais modifier mais trop la flème lol

Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed