swap JS pathname with href to prevent IE incompatibility