Return to Snippet

Revision: 57044
at May 8, 2012 22:20 by vjandrei


Initial Code
<p>Current page URL: <span id="this_url">www.example.com</span>.</p>
<p>Current page title: <span id="this_title">mytitle</span>.</p>
 
<script type="text/javascript">
jQuery(document).ready(function () {
	var href = jQuery(location).attr('href');
	var url = jQuery(this).attr('title');
	jQuery('#this_title').html('<strong>' + href + '</strong>');
	jQuery('#this_url').html('<strong>' + url + '</strong>');
});
</script>

Initial URL

                                

Initial Description

                                

Initial Title
Get current page URL and title with jQuery

Initial Tags
jquery

Initial Language
JavaScript