Capitalizing a domain name in a URL using Javascript
问题 Take a look at the following code: <!--begin of index.html--> <a href="#" id='click'>Click to change url to Index2.html</a> <script type="text/javascript"> var stateObj = { foo: "bar" }; function change_my_url() { history.pushState(stateObj, "page 2", "http://MyDomain.com/Index2.html"); } var link = document.getElementById('click'); link.addEventListener('click', change_my_url, false); </script> <!--end of index.html--> This one is the sample script to change the URL without reloading the