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

WBOY
Release: 2016-05-16 17:24:36
Original
820 people have browsed it
复制代码 代码如下:

$(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");
    });
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template