first, please check this url: Shopify variant options
and when you change the variant dropdown option, the current url will be changed with different variant value.
I tried onpopstate event and Location hash event, but all of them is NOT working , as I know they only work for the url format like: /#!/, but the above shopify link using "?"
Anyone knows how it can change url without reload page ? and how I can create an event when url changed ?