Home >Web Front-end >JS Tutorial >A small example of JS getting address bar parameters_javascript skills

A small example of JS getting address bar parameters_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 17:24:36828browse
复制代码 代码如下:

$(document).ready(function () {
        var locurl = location.href;
        var start = locurl.indexOf("?");
        var end = locurl.length;
        var tempstr = locurl.substring(start 1, end)
        var temp = tempstr.split("=");
        var parm = temp[1] - 1;
        $(".ny_leftc_ul ul li").eq(parm).find("a").addClass("newtxz");
    });
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn