1

How do we get the title of referrer URL page? I can get the referrer by

var referrer = document.referrer;

but unfortunately there's no (document.referrer).title available in javascript similar to document.getElementsByTagName('title')[0].innerHTML.

Any ideas how I can get this value?

1 Answers1

0

If any information about the referer is passed to JavaScript then it will be nothing more than the URL.

To get the title of the page you will need to make an HTTP request to it and parse it out of the HTML.

If you make this HTTP request from JavaScript then it will be subject to the Same Origin Policy (with the usual work-arounds applying).

Community
  • 1
  • 1
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335