<script>
        var href = "http://try.fishqc.local/detail/200"
        var num = href.split("/")
        console.log(num[num.length - 1])
    </script>

一般来说,获取参数用这种方式是不好的,因为带参数,一般不止一个,最后一个也是变动的,所以可以选择其它的方式,看我其他写的博客里面有比较全的

posted on 2018-03-04 20:20  周小姐你好  阅读(250)  评论(2编辑  收藏  举报