Good day
I need this check

if (window.location.href != "http://example.ru/") {alert(1)} else {alert(0)} 

specify that after http://example.ru/ can be any value, check only the subdomain (like http://krasnoyarsk.example.ru/ ), I don’t know how to implement it by inexperience

  • one
    location.origin will most likely fit here, although it looks like it is in few places supported :-) or location.host - Grundy
  • It came up) and found that with support you can handle) Thank you - Ivan Bubliy
  • can you add your answer - Grundy

0