jQuery URL拆分和抓取 [英] jQuery URL split and grab
本文介绍了jQuery URL拆分和抓取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以我有一个URL,我知道如何从URL获取$ _GET,但是我的URL是http://www.example.com/#!/edit/2695
.
So I have a URL and I know how to get $_GET from URL however my URL is http://www.example.com/#!/edit/2695
.
在#!/
之后是否有地方获取网址并吐出零件?我要编辑和ID.
Is there away to grab the url and spit the parts after #!/
? I want edit and the ID.
推荐答案
var edit = window.location.hash.split('/')[1],
ID = window.location.hash.split('/')[2];
这篇关于jQuery URL拆分和抓取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文