I use this code to check which language is on the site and then remove it from the drop-down menu. The code works in Firefox, but does not work on chrome and stops all other scripts. This is the code:
var mylangme = $(location).attr('href'); if(mylangme.contains("/fr/")){ mylangme="French"; $(".subnav li:first-child").css("display","none"); } if(mylangme.contains("/nl/")){ mylangme="Dutch"; $(".subnav li:nth-of-type(2)").css("display","none"); } if(mylangme.contains("/ru/")){ mylangme="Russian"; $(".subnav li:nth-of-type(3)").css("display","none"); } if(mylangme.contains("/en/")){ mylangme="English"; $(".subnav li:last-child").css("display","none"); }
javascript jquery
user2535974
source share