Bonsoir,
Pour rediriger mes utilisateurs je voudrais pouvoir tester l'url de la page en cours. Pour cela j'utilise la fonction indexOf() sur window.location mais ça ne fonctionne pas.
Dans le cas qui m'occupe je dois recherche la chaîne "panier" dans l'URL :
Mais ça ne marche pas!
Code : Sélectionner tout - Visualiser dans une fenêtre à part window.location.indexOf("panier");
Pourtant je pensais que c'était la méthode à appliquer pour LA recherche d'une sous-chaîne... En tous cas window.location me retourne bien une chaîne avec l'URL en cours.window.location.indexOf is not a function
webrider
Partager