Discussion Locked

Javascript command to hide Querystring?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I'd like to know if there's a way to hide the querystring when using Javascript code to submit my Form!? Right now, I'm using the "location = querystring" command to send my query, but the entire Querystring is displayed in the browser's address. Since I'm using Javascript to build my querystring, I can't send a POST method which hides the querystring.

Are there any other Javascript methods I could use instead of the "location=" that will hide the querystring?

Thanks!
Any ideas!?

5 replies

by jay eckles

Have you tried creating a form will all hidden input fields with method=POST - set the values of the hidden fields and then calling submit() on that form using Javascript? That would POST the form rather than GET it, thus solving your querystring problem.

There is no way to "hide" the querystring if the method you use to submit data is GET.

by nikki96

1. Encode the query string using some function you make so that it becomes meaningless. Decode it when you need it.

2. Use frames (there are many, many reasons to NOT use frames).

3. Build the querystring then assign the value to a hidden formelement, then POST the form.

There is no real reason I can see that you MUST use javascript and use a querystring, however, unless the receiving page can't accept POST. There is probably an easier way to do what you are trying to do with POST Butsince you didn't say what you are trying to do, I can't help you there.

HTH
Nikki

This discussion is closed to new replies.