copy current php file in url in js code example Example: get actual url in variable var currentLocation = window.location;