• js获取url参数


    方法代码:

    function getparastr(strname) {
                var hrefstr, pos, parastr, para, tempstr;
                hrefstr = window.location.href;
                pos = hrefstr.indexOf("?")
                parastr = hrefstr.substring(pos + 1);
                para = parastr.split("&");
                tempstr = "";
                for (i = 0; i < para.length; i++) {
                    tempstr = para[i];
                    pos = tempstr.indexOf("=");
                    if (tempstr.substring(0, pos) == strname) {
                        return tempstr.substring(pos + 1);
                    }
                }
                return null;
            }
  • 相关阅读:
    嵌入式
    IT 管理
    linux 网络编程 排序
    linux frameBuffer
    虚拟现实
    vc 串口
    OpenGLES 图像
    runloop
    归档
    商标查询
  • 原文地址:https://www.cnblogs.com/wxh19860528/p/3467440.html
Copyright © 2020-2023  润新知