使用javascript读取/操作查询字符串参数的最简单方法是什么? [英] What is the easiest way to read/manipulate query string params using javascript?
问题描述
我在网上看到的例子似乎比我预期的复杂得多(手动解析& /?/ =成对,使用正则表达式等)。我们正在使用asp.net ajax (在他们的客户端参考中没有看到任何内容)并且会考虑添加jQuery,如果它真的有用。
The examples I've seen online seem much more complex than I expected (manually parsing &/?/= into pairs, using regular expressions, etc). We're using asp.net ajax (don't see anything in their client side reference) and would consider adding jQuery if it would really help.
我会认为那里是一个更优雅的解决方案 - 到目前为止这是我发现的最好的代码但我希望找到更多类似于HttpRequest.QueryString对象(asp.net服务器端)的内容。在此先感谢,
I would think there is a more elegant solution out there - so far this is the best code I've found but I would love to find something more along the lines of the HttpRequest.QueryString object (asp.net server side). Thanks in advance,
Shane
推荐答案
确实有一个< jQuery的一个href =http://plugins.jquery.com/project/query-object =noreferrer> QueryString插件,如果你愿意安装jQuery核心和插件,它可以证明是有用的。
There is indeed a QueryString plugin for jQuery, if you're willing to install the jQuery core and the plugin it could prove useful.
这篇关于使用javascript读取/操作查询字符串参数的最简单方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!