Get Current Page Url using jQuery
Please share your comments and feedback.Thanks.Please subscribe my updates via email.
Live DemoDownload Script
Need library file to perform empty action.Please copy and Paste below library file.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
Need library file to perform empty action.Please copy and Paste below library file.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
jQuery Function
<script type="text/javascript">
$(function () {
var url = $(location).attr('href');
var title= $(this).attr('title');
$('#title').html('<strong>' + title + '</strong>');
$('#url').html('<strong>' + url + '</strong>');
});
</script>
$(function () {
var url = $(location).attr('href');
var title= $(this).attr('title');
$('#title').html('<strong>' + title + '</strong>');
$('#url').html('<strong>' + url + '</strong>');
});
</script>
HTML
<p>Current page URL: <span id="url"></span></p>
<p>Current page title: <span id="title"></span></p>
<p>Current page title: <span id="title"></span></p>
No comments:
Post a Comment