大家好,我有一个网址,我需要从网址获取参数
var URL="http://localhost:17775/Students/199/Kishore"
//here from the url i need to get the value 199
这是我一直在尝试的,但这里的值为 null
function getURLParameter(name) {
return parent.decodeURI((parent.RegExp(name + /([^\/]+)(?=\.\w+$)/).exec(parent.location.href) || [, null])[1]);
};
$(document).ready(function() {
getURLParameter("Students");
//i need to get the value 199 from the url
});