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

前端 未结 3 1821
自闭症患者
自闭症患者 2021-01-17 18:44

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.

相关标签:
3条回答
  • 2021-01-17 19:22

    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).

    0 讨论(0)
  • 2021-01-17 19:27

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

    0 讨论(0)
  • 2021-01-17 19:41

    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.

    0 讨论(0)
提交回复
热议问题