例如:网址 http://localhost:26459/Master.aspx?5
$(function () {
var url = location.search;
if (url.indexOf("?") != -1)//url中存在问号,也就说有参数。
{
alert(url.substr(1));
}
});
弹出来的网页消息是 5
例如:网址 http://localhost:26459/Master.aspx?5
$(function () {
var url = location.search;
if (url.indexOf("?") != -1)//url中存在问号,也就说有参数。
{
alert(url.substr(1));
}
});
弹出来的网页消息是 5
转载于:https://www.cnblogs.com/weimingxin/p/7189773.html