Question window.location.reload (Je suis "noob")

limoges30 Messages postés 1 Date d'inscription vendredi 20 avril 2007 Statut Membre Dernière intervention 12 mai 2011 - 12 mai 2011 à 06:10
MonkeyIsBack Messages postés 9 Date d'inscription vendredi 13 novembre 2009 Statut Membre Dernière intervention 27 juin 2011 - 27 juin 2011 à 13:59
Bonjour tout le monde, je suis un nouveau sur ce site, donc soyez un peu indulgent S.V.P :(
Je suis plutôt débutant et je fais des tests pour m'améliorer, alors j'espère avoir votre aide pour celà ;)

donc, mon problème est je tente de rafraichir une page tout en rafraichissant les valeurs de variables:

<li>[ Facile]</li>

[...]

<script language="JavaScript">
var var1;
var var2;
var var3;
new fonction(var1, var2, var3, "leNomQueJeDonneAMaFonction");
</script>

1 réponse

MonkeyIsBack Messages postés 9 Date d'inscription vendredi 13 novembre 2009 Statut Membre Dernière intervention 27 juin 2011
27 juin 2011 à 13:59
if (window.location.href.indexOf('?') != -1) {
   window.location.href = window.location.href.split('?')[0] + '?var1=a&var2=b&var3=c';
} else {
   window.location.href = window.location.href + '?var1=a&var2=b&var3=c';
}
0
Rejoignez-nous