zoukankan      html  css  js  c++  java
  • window.location.search.substring(1); 什么意思???

    var qs = window.location.search.substring(1);//获得了当前链接的中?号后的参数

    if (qs.length > 0) {

        var Airways = qs.substring(qs.indexOf('=') + 1).toUpperCase();

     

    location.search的值就是 "?i=1 " 
    substr(1)   就是从索引1开始截取 
    所以以这个页面为例的话location.search.substring(1)的值就是 "i=1 "

  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/xiaohui1990/p/3424365.html
Copyright © 2011-2022 走看看