tags:

views:

175

answers:

1

If you enter an invalid video id in YouTube (e.g. http://www.youtube.com/watch?v=XXX) it will redirect you to a page saying it is a malformed video ID. Is there a way to get the original URL (in this example "http://www.youtube.com/watch?v=XXX") in javascript?

(I'm talking about Javascript that will run on the browser after the redirect, through Firebug)

+2  A: 

Are you looking for:

 document.referrer;

http://www.w3schools.com/jsref/prop%5Fdoc%5Freferrer.asp

?

John Boker
No, if you try the scenario you will see that document.referrer is empty.
leras