...

View Full Version : Get the end value of a redirected URL



ripcurlksm
12-17-2007, 10:37 PM
How can I process this redirect URL to get "redirected value" end value using JavaScript?


Lets say this URL:
http://ad.doubleclick.net/ad/website.com/;sect=;subs=;sz=115x77;ord=4771639

Redirected you to:
http://yahoo.com

How can I get the end value of the redirect, "http://yahoo.com", using JavaScript?

Something like this?:

var initValue = "http://ad.doubleclick.net/ad/website.com/;sect=;subs=;sz=115x77;ord=4771639";

var newValue = ?? process(initValue); ?? // opens initValue URL and returns the redirect

document.write(newValue); //outputs "http://yahoo.com"

Philip M
12-18-2007, 08:13 AM
This can't be done with JavaScript (security reasons).
It can only be done using a server-side language.

Of course, locally you can use window.location to redirect depending on initValue.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum