No, the javascript
URI-scheme is just a fake non-standardized scheme, allowed by browsers for backwards compatibility in anchor elements to execute JS. It has been deprecated for a long time in favor of the correct event syntax, like this:
<a onclick="alert('hey!')">Click me!</a>
If you want to execute Javascript 'in a redirect' you should reverse the approach - instead of doing a server request directly, use an Ajax request to invoke the serverside code, and then use an onSuccess
callback to execute the JS code to be run afterwards.
It is even possible, easily with libraries like jQuery or Mootools, or manually using eval
, to have an Ajax request actually return Javascript code which is then executed, allowing you even more flexibility.