js中获取url参数

function GridRowOnDblClick(strFile, pkValue, rowIndex) {   

       var myJSON = {

            value1: ‘‘,

            value2: ‘‘,

            load: function () {

            },

            serialize: function () {

                var json = "";

                for (var key in this) {

                    if (typeof this[key] != ‘function‘) {

                        json += (json != "" ? "," : "") + key + ":‘" + this[key] + "‘";

                    }

                }

                json = ‘{‘ + json + ‘}‘;

                return json;

            }

        }//end of myJSOON

      

      var obj = getUrlArgs();  //JS获取URL参数 

 

        if (typeof(myJSON) != ‘undefined‘) {

              myJSON.value1 = obj.CS;// URL参数

              myJSON.value2 = pkValue;

       }

        $.ajax({

        type: "POST",

        contentType: "application/json",

        url: "/SlnWLPZ/KCWLPZ.aspx/GetCKWish",    

              data:myJSON.serialize(),

        dataType: ‘json‘,

        success: function (result) {

            var json = eval(result.d);

            if (json == "1") {

              var r=rowIndex*1+1;

              var grid = document.all.grdTest;  

              var selectedRow = grid.rows[r];   

              selectedRow.style.backgroundColor = ‘#76EE00‘;          

            }

            if (json == "0") {

                alert(‘配置出错‘);

            }

            return false;

        } //success: function(result)

    }); //$.ajax

    return false;

}

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。