I want to check if the word ["sublanguageid-all" for a specific] is present in the current address of the page with the condition "if". I tried / sublanguageid -all / g but I cannot put it in if-statement
Not
if(window.location.href.indexOf('sublanguageid-all') != -1)
Work?
if( location.href.match("sublanguageid-all") ) { alert('present') }
Source: https://habr.com/ru/post/913714/More articles:get validation errors through jquery ajax and codeigniter - jqueryRunning Eclipse Error Code = 1? - javaIs there a way to declare the / DependencyProperty property to use the TwoWay default binding if its binding? - .netjquery how to check if url contains word? - javascriptJava hash of 2 hashes - javaJavascript for conditional add or redirect URL based on window.location.href - javascriptApple iOS App Icon Name: Maximum Length? - iosThe hash code for a group of three fields - javato determine if a row of column values โโstarts with a number - sql-serverTabindex Style Styles - htmlAll Articles