码迷,mamicode.com
首页 > Web开发 > 详细

js 获取当前url参数

时间:2014-07-03 00:43:57      阅读:299      评论:0      收藏:0      [点我收藏+]

标签:style   color   strong   os   2014   cti   

2014-7-1 应用在某内网应用排序管理页面跳转:

 

function goSortManage() {
    var name = ‘TypeID‘;
    var TypeID = "0";
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
    }

    if (theRequest != null && theRequest[‘TypeID‘] != undefined) {

        TypeID = theRequest[‘TypeID‘];
    }
    

     var url = ‘/tabid/294/Default.aspx?f_ID=‘ + TypeID + "&columns=7";

   window.location.href = url;

   }

 

注意:

1: theRequest[‘TypeID‘] != undefined   而不是 theRequest[‘TypeID‘] != "undefined"

 

js 获取当前url参数,布布扣,bubuko.com

js 获取当前url参数

标签:style   color   strong   os   2014   cti   

原文地址:http://www.cnblogs.com/huangyugui/p/3818662.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!