Click to See Complete Forum and Search --> : modify a url


Webskater
01-29-2003, 09:11 AM
Is it possible to change a value in URL as it hits the browser.

If a page has a URL of:
www.somesite.com/ViewJob.htm?JobNumber=27

Is it possible to change it to:
www.somesite.com?ViewJob.htm?JobNumber=28

so that if someone refreshes the page it will go to a different page.

khalidali63
01-29-2003, 11:21 AM
I don't think you can do that.Reason?
Well JavaScript is works only on objects that are loaded in the browser.It does not have any scope beyond the browser security.
Hence if you want to change any thing that is not loaded in the browser as yet,I don't see how you will be able to do that with JavaScript.

Second if you have to do something like this,I'd suggest in the head section in the script tags
just do this.

document.location.href=document.location.href+"?JobNumber=28";

this should do exactly what you want..

cheers

Khalid