从url表单jquery / javascript中获取特定值

时间:2013-04-14 06:27:57

标签: jquery url-parsing

我有一个网址,如http://www.example.com/wall/post/1234568929842184
现在我想从javascript或jquery发布/从我的网址中获取数字。

1 个答案:

答案 0 :(得分:0)

看看here

在你的情况下:

var href = window.location.href;
window.alert(href.substr(href.lastIndexOf('/') + 1));