如何从网址获取参数? [英] how to get the parameter from a url?

查看:56
本文介绍了如何从网址获取参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的网址. http://localhost:8080/steer/trip/create/3 .在哪里 在我的页面中,我想使用jquery获得值"3".请帮助我

i have a url like this. http://localhost:8080/steer/trip/create/3. where in my page i want to get value "3" using the jquery . please help me

推荐答案

来自: 根据位置突出显示按钮

var pathname = window.location.pathname.split("/");
var filename = pathname[pathname.length-1];

alert(filename);

这篇关于如何从网址获取参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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