page01.html In my page01.html file there is a link code: <a href="page02.html?name=abc">go to page 2 </a> page02.html I need a JavaScript code in this page that will take the value of 'name' from the url when a visitor comes from clicking the above link from page01.html. Thanks
This should work: var url = location.href; var parts = url.split('='); var name = parts[1]; Code (markup):