javascript - How do you get querystring using YUI 2? - Stack Overflow

I need to get the a parameter passed via a querystring. I need to get the value of the parameter and th

I need to get the a parameter passed via a querystring. I need to get the value of the parameter and then use it in some javascript.

In my specific example, I am using the "tabview" object and would like to set the "selected" tab by getting it from the querystring. The querystring would be something like this

.html?tab=3

So, I want to get the "tab" parameter and extract the value to preset the tab on form i am displaying..

Thanks..

I need to get the a parameter passed via a querystring. I need to get the value of the parameter and then use it in some javascript.

In my specific example, I am using the "tabview" object and would like to set the "selected" tab by getting it from the querystring. The querystring would be something like this

http://www.myserver./pagex.html?tab=3

So, I want to get the "tab" parameter and extract the value to preset the tab on form i am displaying..

Thanks..

Share Improve this question asked Mar 4, 2010 at 2:30 angryITguyangryITguy 9,5518 gold badges59 silver badges85 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

It's well hidden in the History module.

If you have a page at a url like:

http://my.site./foo.html?QUERY=bar&OTHER=stuff

Then you can get the value for QUERY using:

var string = YAHOO.util.History.getQueryStringParameter('QUERY'); //returns "bar"

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744866872a4598027.html

相关推荐

  • javascript - How do you get querystring using YUI 2? - Stack Overflow

    I need to get the a parameter passed via a querystring. I need to get the value of the parameter and th

    1天前
    50

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信