So far I've tried:
1) Getting the whole code of the page and then separating the title from it by using
So, I just wanted to know if there is any better way of doing this.
Best How To :
You could the title of the page using
var title = document.title;
If you want to get the title of the page using
jQuery, you could try this:
var title = $('title').text();
The above can be applied, if you are the "owner" of the page. If you want to get the
title of a page given it's
url, there is a helpful link here, which addresses this problem.