Need method to get "Current Url" and then display it on the web page

Need method to get "Current Url" and then display it on the web page

I'm trying to get the current page url.......  and then display it for use in the html page as a "template tag" where it will display the url wherever the tag is placed on the page.

So it could be used in making a canconical meta tag, or making a link to the current page somewhere on the page for instance.

I've been given this code

<script type="text/javascript">
jQuery(document).ready(function() {
var href = jQuery(location).attr('href');
var url = jQuery(this).attr('title');
jQuery('#current_title').html(href);
jQuery('#current_url').html(url);
});
</script>

Will this pull the current url correctly?

How then can I display the result?  Anywhere  #current_url is placed in the html code it will print?

Bottom line is I need to pull the current url and then display it where needed in the page.

Any help asap would be greatly appreciated!