IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

propriété onChange sur un select, pb sous IE7 !


Sujet :

JavaScript

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé Avatar de avogadro
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    412
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 412
    Par défaut propriété onChange sur un select, pb sous IE7 !
    Bonjour,

    sous FF tout passe parfaitement mais sous IE7 ca bloque alors que c'est du banal javascript... :s

    HTML:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    <select id="optsel" onChange="toto(this.options[this.selectedIndex].value);">
    <option>Select your Location</option>
    <option>Alsace</option>
    <option>Caraibes</option>
    <option>China</option>
    <option>Paris</option>
    </select>
    <br/>
    <div id="cams"></div>
    <br/><br/><br/>
    <div id="movie"></div>
    et le js dans le head est :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    function toto(valeur){
    switch(valeur)
    {
    case "Alsace":
    	document.getElementById("cams").innerHTML = "<br/><select id=\"camsel\" onChange=\"toto2(this.options[this.selectedIndex].value);\"><option>Select your Cam</option><option>http://10.3.64.7/mjpg/video.mjpg?resolution=640x480</option><option>http://10.3.64.8/mjpg/video.mjpg?resolution=640x480</option><option>http://10.3.64.6/mjpg/video.mjpg?resolution=640x480</option><option>http://10.3.64.5/mjpg/video.mjpg?resolution=640x480</option><option>http://10.3.64.4/mjpg/video.mjpg?resolution=640x480</option><option>http://10.3.64.3/mjpg/video.mjpg?resolution=640x480</option><option>http://10.3.64.2/mjpg/video.mjpg?resolution=640x480</option><option>http://10.3.64.1/mjpg/video.mjpg?resolution=640x480</option></select><br/>";
    	break;
    case "Caraibes":
    	document.getElementById("cams").innerHTML = "<br/><select id=\"camsel\" onChange=\"toto2(this.options[this.selectedIndex].value);\"><option>Select your Cam</option><option>http://10.2.64.100/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.101/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.11/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.10/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.51/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.50/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.41/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.40/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.21/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.20/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.31/mjpg/video.mjpg?resolution=640x480</option><option>http://10.2.64.30/mjpg/video.mjpg?resolution=640x480</option></select><br/>";
    	break;
    case "China":
    	document.getElementById("cams").innerHTML = "<br/><select id=\"camsel\" onChange=\"toto2(this.options[this.selectedIndex].value);\"><option>Select your Cam</option><option>http://10.5.64.5/mjpg/video.mjpg?resolution=640x480</option><option>http://10.5.64.4/mjpg/video.mjpg?resolution=640x480</option><option>http://10.5.64.6/mjpg/video.mjpg?resolution=640x480</option><option>http://10.5.64.7/mjpg/video.mjpg?resolution=640x480</option><option>http://10.5.64.8/mjpg/video.mjpg?resolution=640x480</option></select>";
    	break;
    case "Paris":
    	document.getElementById("cams").innerHTML = "<br/><select id=\"camsel\" onChange=\"toto2(this.options[this.selectedIndex].value);\"><option>Select your Cam</option><option>http://10.1.64.1/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.2/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.103/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.101/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.102/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.201/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.4/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.5/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.6/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.3/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.44/mjpg/video.mjpg?resolution=640x480</option><option>http://10.1.64.41/mjpg/video.mjpg?resolution=640x480</option></select>";
    	break;
    default:	
    	break;
     
    }
    }
    sous FF c'est niquel, un dossier select se met sous le premier, alors que sous IE, rien :s

    Quelqu'une a une idée svp??

    Merci (ourf qu'il est tard :s)

  2. #2
    Membre Expert
    Avatar de ryan
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2003
    Messages
    956
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Belgique

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Juin 2003
    Messages : 956
    Billets dans le blog
    1
    Par défaut
    Yop!

    A tout hasard: une limitation dans la longueur de la chaine que tu peux assigner à l'innerHTML...

  3. #3
    Membre éclairé Avatar de avogadro
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    412
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 412
    Par défaut
    non, pas de limitation, avec un "blop" ca passe pas non plus

Discussions similaires

  1. onchange sur un select sous IE
    Par Timbermat dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 20/04/2011, 15h32
  2. onchange sur un SELECT : passage de paramètre
    Par NikoBe dans le forum Général JavaScript
    Réponses: 8
    Dernier message: 31/10/2006, 11h14
  3. 2 actions sur evenement onchange sur champ Select
    Par falz222 dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 31/08/2006, 20h59
  4. onChange sur un SELECT
    Par linar009 dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 18/07/2006, 10h14
  5. [Onchange] sur checkbox selection ds une liste deroulante
    Par maxxou dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 06/01/2006, 00h17

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo