[Javascript] capture & redirect URL

Paul Novitski paul at novitskisoftware.com
Thu Jan 5 11:22:46 CST 2006


At 07:14 AM 1/5/2006, Tom Allison wrote:
>I know there are ways to capture href links and rewrite the addresses
>using a variety of server/proxy side tools.  But I found that these
>rewrites can't manage the URL's that are in javascript simply because
>there aren't the regex matches available.

Hi Tom,

The second sentence above reads like it's become derailed from 
reality, so maybe I'm just not understanding what you mean.

1) In my experience the Regular Expression capabilities of 
server-side languages (VBscript and PHP) are greater than or equal to 
those of JavaScript, including the number of regexp matches which we 
receive as arrays with practically unlimited bounds in any language.

2) I wouldn't say that there are any "URLs in javascript" per se; 
we're going to encounter URLs as either text-strings in an HTML page 
or values of HTTP header fields, and in either case they travel down 
the pipe from the server to the client and are therefore accessible 
to both server-side scripts and client-side scripts.  I'd say the 
only things that javascript can see that a server-side script can't 
are the user's actions (on keyboard, mouse, microphone, etc.) between 
download and submit.

I much prefer to redirect pages from a server-side script when user 
interaction isn't a factor.  You can redirect in a single operation 
without forcing a round-trip between server and client, and you can 
rest assured that your redirects will work regardless of whether 
javascript is enabled in the client.

If I'm missing something here because of my limited knowledge of 
proxy servers, please elucidate.

Regards,
Paul 




More information about the Javascript mailing list