jquery / javascript访问查询字符串/路径 [英] jquery/javascript access querystring/path

查看:93
本文介绍了jquery / javascript访问查询字符串/路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有几个标签,我希望它们之间能够切换后退按钮

I've got a couple of tabs on my page and I'd like the switching between them to be back-button-able

我的想法是让选项卡按钮链接到#tab1和#tab2,然后让jquery选择#tabX并显示/隐藏相关选项卡。

My idea was to let the tab-buttons link through to #tab1 and #tab2, and then let jquery pick up the #tabX and show/hide the relevant tab.

这可能吗?如何从jquery / javascript访问URL中的#whatever?

Is this possible? How can i get access to the #whatever in the url from jquery/javascript?

谢谢

Andrew

推荐答案

您正在寻找

location.hash

您还可以通过查看此jquery历史插件。祝你好运!

You might also save a lot of time by looking at this jquery history plugin. Good luck!

这篇关于jquery / javascript访问查询字符串/路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆