Programming Tips - javaScript: How can I get the current URL?

Date: 2009dec28 Language: javaScript Platform: web Level: novice Q. javaScript: How can I get the current URL? A. Access the href member of the location object like this:
function displayCurrentUrl() { alert('Current URL is ' + location.href); }