Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hiding Query Strings

Status
Not open for further replies.

Krus1972

Programmer
Mar 18, 2004
145
US
Hello,

I have to redirect my visitors to a new page within my site using ASP. The new page has a very long querystring.

Can someone help me with a javascript snippet that I can place on the redirect page that will tell the user's browser not to show the query string in the user's address bar? I only would like the domain to show and no query string.

Thanks for any help.
 
Then you'll either have to use framesets, or store that information first. The only way to remove the query string is to visit a URL that doesn't have it - you cannot simply mask it.

That aside, to visit a URL in JS, you can use:

Code:
window.location = '[URL unfurl="true"]http://some.web.address/';[/URL]

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
...I only would like the domain to show and no query string.
You should do this param cleansing server-side (not using a client-side solution). Using ASP you can do a redirect to the URL without the query params.

Cheers,
Jeff

[tt]Visit my blog [!]@[/!] Visit Code Couch [!]@[/!] [/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top