I am redirecting from some page to index.html. Page redirect to index by using following address in the address bar: http://localhost/index.html?page.html
How can I read the value after ?
sign and insert it (page.html) into index.html file?
href => This will return the entire URL displaying in the address bar.
HTML5 History API allows browsers to change the URL in browser address bar without reloading or refreshing the page using pushState function. The pushState method works similar to window.
On your computer, go to google.com. Search for the page. In search results, click the title of the page. At the top of your browser, click the address bar to select the entire URL.
From the top menu, select Tools > Web Developer > Page Source. A new tab will open with the page's code, which you can copy by highlighting a specific area or by right-clicking to Select All if you want all of the code. Press Ctrl+C or Command+C on your keyboard and paste it into a text or document file.
var url = window.location.href;
var params = url.split('?');
alert(params[1]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With