If window.location = " "
jean r
-
animostab Messages postés 3003 Date d'inscription Statut Membre Dernière intervention -
animostab Messages postés 3003 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
sur mon site qui n'est pas encore accessible, j'aimerai créer un code javascript tel que
if ()
{
window.location = "http://mosite.com/";
}
else (){
window.history.back()
}
comment faire ?
Merci
sur mon site qui n'est pas encore accessible, j'aimerai créer un code javascript tel que
if ()
{
window.location = "http://mosite.com/";
}
else (){
window.history.back()
}
comment faire ?
Merci
1 réponse
Voila un code qui te met retour page précédente a toutes les pages qui ne sont pas http://monsite.com/
<script type="text/javascript">
var Goback ='<A href="javascript:history.go(-1)">Retour</A>';
if (window.location != "http://monsite.com/")
{document.getElementById('divback').innerHTML = Goback};
else
{document.getElementById('divback').innerHTML = ''}; /*attention ici c'est 2 ' et pas 1" */
</script>
<div id="divback"></div>
Un petit merci vaut mieux qu'une grande ignorance
<script type="text/javascript">
var Goback ='<A href="javascript:history.go(-1)">Retour</A>';
if (window.location != "http://monsite.com/")
{document.getElementById('divback').innerHTML = Goback};
else
{document.getElementById('divback').innerHTML = ''}; /*attention ici c'est 2 ' et pas 1" */
</script>
<div id="divback"></div>
Un petit merci vaut mieux qu'une grande ignorance