首页 > Web开发 > 详细

js 获取当前url参数

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

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参数

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!