How does position of parameters in a Query string affect the page?

Go To


I have an application with most of the code written in javascript. I am encountering a strange problem. I have a query string and my app reads it to perform various actions. Yesterday I changed the ordering of the query string parameters and the application stopped working. If I put the original order back then it starts working. What could be the reason? I thought that the effect of ordering of parameters should not matter. But, apparently it does matter for some reason. I am still trying to dig out what can be the issue but wanted to know if any one here has encountered a similar problem?


2012-04-04 05:21
by Blueboye
can you put the code - Joseph 2012-04-04 05:22
I didnt get time earlier to check what's the problem. I m going to check today and let you guys know. Thanks - Blueboye 2012-04-04 23:44


A properly written application will find a given query parameter in any order and will not be order sensitive. It is possible though to have poorly written parsing code that would only find a given parameter at the beginning, at the end, or only if after some other parameter. Without seeing the code that parses the query parameters, we can't really say what problem it has, but it is possible to have poorly written code that is position-sensitive.

If you post the code that parses the query parameters and the query string that works and the one that doesn't, we could advise more specifically. You should also check to make sure that your query parameters don't have any characters in them that are supposed to be encoded that could be throwing things off.

2012-04-04 05:53
by jfriend00


It should not a problem. Something else couse the error. Or you have some dependencys on the location variable that contains the URL.

2012-04-04 05:23
by Simon Edström


I have seen that kind of problem when the developer used the query string, as is, as a key to a cached object. When the query string changed, the key was not the same and the cache mechanism was failing (due to another bug).

2012-04-04 06:03
by Simon Mourier